{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tlsradar-com/json-schema/tlsradar-com-host-detail-schema.json",
  "title": "HostDetail",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tlsradar-com-openapi.json#/components/schemas/HostDetail",
  "allOf": [
    {
      "$ref": "#/$defs/Host"
    },
    {
      "type": "object",
      "properties": {
        "latest_scan": {
          "type": "object",
          "description": "Present once the host has been scanned",
          "properties": {
            "scanned_at": {
              "type": "string",
              "format": "date-time"
            },
            "status": {
              "type": "string",
              "enum": [
                "success",
                "failed"
              ]
            },
            "elapsed_time": {
              "type": [
                "number",
                "null"
              ]
            },
            "certificate": {
              "type": [
                "object",
                "null"
              ],
              "description": "The leaf certificate the host served",
              "properties": {
                "issuer": {
                  "type": "string"
                },
                "subject": {
                  "type": "string"
                },
                "valid_from": {
                  "type": "string",
                  "format": "date-time"
                },
                "valid_until": {
                  "type": "string",
                  "format": "date-time"
                },
                "serial_number": {
                  "type": "string"
                },
                "public_key_algorithm": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Host": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "address": {
          "type": "string",
          "description": "Domain name (e.g., example.com)"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "disabled"
          ]
        },
        "last_scan_status": {
          "type": [
            "string",
            "null"
          ]
        },
        "last_scanned_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiration_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "expiring_soon": {
          "type": "boolean",
          "description": "True if the certificate is unexpired and inside its expiry-warning window. The window opens shortly after an automated client should have renewed (a third of the lifetime left) and is never longer than 30 days: 28 days for a 90-day certificate, 19 for a 64-day one"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}