{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/domainlab-app/json-schema/domainlab-app-scan-schema.json",
  "title": "Scan",
  "description": "One monitoring result (scan snapshot) for a domain",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/domainlab-app-openapi.json#/components/schemas/Scan",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time"
    },
    "registrar": {
      "type": [
        "string",
        "null"
      ]
    },
    "expiration_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "creation_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "domain_status": {
      "type": [
        "string",
        "null"
      ],
      "description": "Registry EPP status codes, normalized (sorted, lowercase), or \"available\""
    },
    "site_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "available",
        "parked",
        "for-sale",
        "dead",
        "down",
        "active",
        null
      ],
      "description": "Web-layer status computed each scan (down = the site answers with a server error); null when classification was unavailable"
    },
    "ssl_issuer": {
      "type": [
        "string",
        "null"
      ]
    },
    "ssl_valid_from": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "ssl_valid_to": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "ssl_cipher": {
      "type": [
        "string",
        "null"
      ]
    },
    "ssl_protocol": {
      "type": [
        "string",
        "null"
      ]
    },
    "subject": {
      "type": [
        "string",
        "null"
      ]
    },
    "serial_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "fingerprint": {
      "type": [
        "string",
        "null"
      ]
    },
    "security_score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "nameservers": {
      "type": [
        "string",
        "null"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Non-null when this scan failed"
    },
    "dns_records": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DnsRecord"
      }
    }
  },
  "$defs": {
    "DnsRecord": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "record_type": {
          "type": "string",
          "description": "A, AAAA, CNAME, MX, TXT, or NS"
        },
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "ttl": {
          "type": [
            "integer",
            "null"
          ]
        },
        "priority": {
          "type": [
            "integer",
            "null"
          ],
          "description": "MX priority"
        }
      }
    }
  }
}