{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/immowelt/json-schema/immowelt-create-lead-request-schema.json",
  "title": "createLeadRequest",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/immowelt-seeker-leads-openapi.yml#/components/schemas/createLeadRequest",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "Maximum length is 100 characters"
    },
    "lastName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "Maximum length is 100 characters"
    },
    "gender": {
      "type": "string",
      "enum": [
        "MALE",
        "FEMALE",
        "OTHER",
        "PREFER_NOT_TO_DISCLOSE"
      ]
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "language": {
      "type": "string",
      "default": "DE",
      "enum": [
        "DE",
        "EN",
        "ES",
        "FR",
        "HE",
        "IT",
        "NL",
        "PT",
        "RU"
      ]
    },
    "phoneNumbers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/phoneNumberInput"
      },
      "minLength": 1
    },
    "message": {
      "type": "string"
    },
    "classifiedId": {
      "type": "string",
      "pattern": "^([0-9]{2})([1-9A-NP-Z]{10})$",
      "description": "Classified identifier in the format ^([0-9]{2})([1-9A-NP-Z]{10})$"
    },
    "submittedDate": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time when the lead was submitted in ISO 8601 format"
    }
  },
  "required": [
    "lastName",
    "email",
    "classifiedId",
    "submittedDate",
    "message",
    "phoneNumbers"
  ],
  "$defs": {
    "phoneNumberInput": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "MOBILE",
            "LANDLINE"
          ],
          "description": "Type of phone number. Could be ignored as it should be MOBILE most of the time."
        },
        "number": {
          "type": "string",
          "description": "Phone number",
          "pattern": "^[+]?[0-9() \\/.\\-]{6,21}[0-9]$"
        }
      },
      "required": [
        "number"
      ]
    }
  }
}