{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ctlogs-dev/json-schema/ctlogs-dev-cert-list-schema.json",
  "title": "CertList",
  "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/CertList",
  "type": "object",
  "properties": {
    "rows": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CertRow"
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Searches answer [] when nothing matches; a CA's issued list with nothing in the window is null."
    },
    "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."
    },
    "history_truncated": {
      "type": "boolean",
      "description": "Page 1 of a windowed list only, when known: whether older certificates exist outside the window. /v1/domain and /v1/subdomains send it only as true; when it is absent there, older certificates may still exist."
    },
    "upgrade": {
      "type": "string",
      "description": "When history_truncated is true: where the window is lifted (the plans; for a Pro key, the archive=full parameter)."
    },
    "truncated": {
      "type": "boolean",
      "description": "/v1/spki only: the key is shared by more certificates than the pages cover."
    },
    "ca_certs": {
      "type": "array",
      "description": "/v1/spki page 1 only: CA certificates carrying this key.",
      "items": {
        "$ref": "#/$defs/CACard"
      }
    }
  },
  "required": [
    "rows",
    "has_next",
    "next_cursor"
  ],
  "$defs": {
    "CACard": {
      "type": "object",
      "properties": {
        "sha256": {
          "type": "string",
          "description": "SHA-256 of the CA certificate."
        },
        "subject_dn": {
          "type": "string"
        },
        "issuer_dn": {
          "type": "string"
        },
        "not_before": {
          "type": "string",
          "format": "date-time"
        },
        "not_after": {
          "type": "string",
          "format": "date-time"
        },
        "self_signed": {
          "type": "boolean"
        }
      },
      "required": [
        "sha256",
        "subject_dn",
        "issuer_dn",
        "not_before",
        "not_after",
        "self_signed"
      ]
    },
    "CertRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Certificate id for /v1/cert/{id}; archive certificates carry a -yyyymm suffix."
        },
        "match": {
          "type": "string",
          "description": "The name or value that matched."
        },
        "matches": {
          "type": "array",
          "description": "/v1/domain and /v1/subdomains without archive=: every name of the certificate under the queried domain, the apex first; match is the first of them. Absent on pages by hostname (archive=).",
          "items": {
            "type": "string"
          }
        },
        "not_before": {
          "type": "string",
          "format": "date-time"
        },
        "not_after": {
          "type": "string",
          "format": "date-time"
        },
        "serial_hex": {
          "type": "string",
          "description": "Serial number, lower-case hex."
        },
        "issuer": {
          "type": "string",
          "description": "Issuer common name."
        },
        "key_algo": {
          "type": "string",
          "description": "Public key algorithm."
        },
        "san_count": {
          "type": "integer",
          "description": "Number of SAN entries."
        },
        "subject_cn": {
          "type": "string",
          "description": "Organization search only."
        },
        "domains": {
          "type": "array",
          "description": "Organization search only: the certificate's names, first few.",
          "items": {
            "type": "string"
          }
        },
        "domains_more": {
          "type": "integer",
          "description": "Organization search only: names not listed in domains."
        }
      },
      "required": [
        "id",
        "not_before",
        "not_after",
        "serial_hex"
      ]
    }
  }
}