{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ctlogs-dev/json-schema/ctlogs-dev-host-list-schema.json",
  "title": "HostList",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/ctlogs-dev-api-openapi.json#/components/schemas/HostList",
  "type": "object",
  "properties": {
    "hosts": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HostRow"
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "null when nothing matches."
    },
    "has_next": {
      "type": "boolean",
      "description": "Whether another page follows."
    },
    "next_cursor": {
      "type": "string",
      "description": "Pass as ?after= for the next page; empty on the last page."
    },
    "duration_ms": {
      "type": "integer",
      "description": "Server-side time of the query."
    },
    "history_window_days": {
      "type": "integer",
      "description": "Present on every windowed page: rows are certificates valid now or expired within this many days. Absent with archive=full."
    }
  },
  "required": [
    "hosts",
    "has_next",
    "next_cursor"
  ],
  "$defs": {
    "HostRow": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "description": "Hostname (wildcards included)."
        },
        "certs": {
          "type": "integer",
          "description": "Certificates in the window naming it."
        },
        "first_seen": {
          "type": "string",
          "description": "Earliest validity start of those certificates.",
          "format": "date-time"
        },
        "last_seen": {
          "type": "string",
          "description": "Latest validity start of those certificates.",
          "format": "date-time"
        },
        "last_not_after": {
          "type": "string",
          "description": "Expiry of the latest one.",
          "format": "date-time"
        }
      },
      "required": [
        "host",
        "certs",
        "first_seen",
        "last_seen",
        "last_not_after"
      ]
    }
  }
}