{
  "openapi": "3.1.0",
  "info": {
    "title": "ctlogs.dev API",
    "version": "1",
    "description": "Certificate Transparency search: certificates by domain, organization, serial, fingerprint, public key or CA, and the hostnames under a domain. Requests work without a key (shared pool, 100 per day); keys come from https://account.ctlogs.dev/. Docs: https://api.ctlogs.dev/",
    "termsOfService": "https://ctlogs.dev/terms",
    "contact": {
      "email": "contact@ctlogs.dev",
      "url": "https://api.ctlogs.dev/"
    }
  },
  "servers": [
    {
      "url": "https://api.ctlogs.dev"
    }
  ],
  "security": [
    {},
    {
      "bearerAuth": []
    },
    {
      "queryKey": []
    }
  ],
  "tags": [
    {
      "name": "certificates"
    },
    {
      "name": "hostnames"
    },
    {
      "name": "lookup"
    },
    {
      "name": "account"
    }
  ],
  "paths": {
    "/v1/domain/{domain}": {
      "get": {
        "operationId": "domain",
        "summary": "Certificates for exactly this name",
        "description": "Certificates whose subject CN or SAN dNSName equals {domain}; newest first, 100 per page. Certificates valid now or expired within the last 90 days; archive=full (Pro plan) lifts the window.",
        "tags": [
          "certificates"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "$ref": "#/components/parameters/after"
          },
          {
            "$ref": "#/components/parameters/archive"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/subdomains/{domain}": {
      "get": {
        "operationId": "subdomains",
        "summary": "Certificates for a domain and every name under it",
        "description": "Certificates naming {domain} or any name under it; newest first, 100 per page. Certificates valid now or expired within the last 90 days; archive=full (Pro plan) lifts the window.",
        "tags": [
          "certificates"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "$ref": "#/components/parameters/after"
          },
          {
            "$ref": "#/components/parameters/archive"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/hosts/{domain}": {
      "get": {
        "operationId": "hosts",
        "summary": "Hostnames under a domain",
        "description": "One row per distinct hostname under {domain}, in reversed-name order, 100 per page. Paging needs an API key. Certificates valid now or expired within the last 90 days, on every plan; archive= is refused with a 400 - every hostname since 2013 is /v1/hosts-history/{domain} (Pro Lite or Pro plan).",
        "tags": [
          "hostnames"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "$ref": "#/components/parameters/after"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/org": {
      "get": {
        "operationId": "org",
        "summary": "Certificates by organization",
        "description": "Certificates by subject organization (O=): 4+ characters match case-insensitively anywhere in the name, shorter queries exactly. Costs 10 credits; without a key it counts as 10 of the 100 daily requests. Certificates valid now or expired within the last 90 days; archive=full (Pro plan) lifts the window and merges the archive back to 2013.",
        "tags": [
          "certificates"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Organization name, 1-200 characters.",
            "schema": {
              "type": "string"
            },
            "example": "PayPal, Inc."
          },
          {
            "$ref": "#/components/parameters/after"
          },
          {
            "$ref": "#/components/parameters/archive"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/TooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/bimi": {
      "get": {
        "operationId": "bimi",
        "summary": "BIMI mark certificates",
        "description": "Verified and Common Mark Certificates (VMC/CMC) by domain (a query with a dot) or organization; newest first, 50 per page. Marks valid now or expired within the last 90 days; archive=full (Pro plan): every mark since 2019.",
        "tags": [
          "certificates"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "A domain or an organization name.",
            "schema": {
              "type": "string"
            },
            "example": "cnn.com"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Override the guess: domain or org.",
            "schema": {
              "type": "string",
              "enum": [
                "domain",
                "org"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/after"
          },
          {
            "$ref": "#/components/parameters/archive"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BimiList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/hosts-history/{domain}": {
      "get": {
        "operationId": "hostsHistory",
        "summary": "Every hostname ever seen under a domain (Pro Lite, Pro)",
        "description": "Pro Lite and Pro plans. Every hostname seen in a certificate under {domain} since 2013, sorted by name, 100 per page.",
        "tags": [
          "hostnames"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "$ref": "#/components/parameters/after"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostsHistoryList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/first-seen/{domain}": {
      "get": {
        "operationId": "firstSeen",
        "summary": "When a name first and last appeared in CT (Pro Lite, Pro)",
        "description": "Pro Lite and Pro plans. The earliest and latest CT record of one name since 2013; a name without its own record gets its one-label wildcard parent's.",
        "tags": [
          "hostnames"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FirstSeen"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/cert/{id}": {
      "get": {
        "operationId": "cert",
        "summary": "One certificate",
        "description": "Full record of one certificate by a search-result id or a 64-hex SHA-256 fingerprint: names, validity, extensions, every CT log entry.",
        "tags": [
          "lookup"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A search-result id (hex, archive ids with -yyyymm) or a SHA-256 fingerprint.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/cert/{id}/{body}": {
      "get": {
        "operationId": "certBody",
        "summary": "A certificate's raw body",
        "tags": [
          "lookup"
        ],
        "description": "The precertificate or final certificate as PEM or DER, when it can be downloaded (precert_body_archived / final_body_archived).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "body",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "final.pem",
                "final.der",
                "precert.pem",
                "precert.der"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The body.",
            "content": {
              "application/x-pem-file": {
                "schema": {
                  "type": "string"
                }
              },
              "application/pkix-cert": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/serial/{serial}": {
      "get": {
        "operationId": "serial",
        "summary": "Certificates by serial number",
        "description": "Certificates with this serial number (4-42 hex characters, colons allowed), valid now or expired within the last 90 days, on every plan; archive= is refused with a 400.",
        "tags": [
          "lookup"
        ],
        "parameters": [
          {
            "name": "serial",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0aabbccdd"
          },
          {
            "$ref": "#/components/parameters/after"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/spki/{hash}": {
      "get": {
        "operationId": "spki",
        "summary": "Certificates sharing one public key",
        "description": "Certificates whose public key has this SHA-256 (pubkey_sha256 of /v1/cert), valid now or expired within the last 90 days, on every plan; archive= is refused with a 400.",
        "tags": [
          "lookup"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/hex64"
          },
          {
            "$ref": "#/components/parameters/after"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CertList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/ca/{sha256}": {
      "get": {
        "operationId": "ca",
        "summary": "A CA certificate and what it issued",
        "description": "The CA certificate with this SHA-256 (issuer_ca of /v1/cert): its card, parents and cross-signs, and one page of the certificates it issued (issued, in serial order). Certificates valid now or expired within the last 90 days; the Pro plan lifts the window.",
        "tags": [
          "lookup"
        ],
        "parameters": [
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "description": "64 hex characters (colons allowed).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F:]+$"
            }
          },
          {
            "$ref": "#/components/parameters/after"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CADetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "usage",
        "summary": "Plan and remaining quota",
        "description": "The key's plan, monthly credits and, for free keys, the hourly count; costs nothing. Needs a key.",
        "tags": [
          "account"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-Hourly-Limit": {
                "$ref": "#/components/headers/X-Hourly-Limit"
              },
              "X-Hourly-Remaining": {
                "$ref": "#/components/headers/X-Hourly-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer <key>"
      },
      "queryKey": {
        "type": "apiKey",
        "in": "query",
        "name": "key"
      }
    },
    "parameters": {
      "domain": {
        "name": "domain",
        "in": "path",
        "required": true,
        "description": "Any DNS name, URL-encoded: example.com, www.example.com or *.example.com.",
        "schema": {
          "type": "string"
        },
        "example": "example.com"
      },
      "after": {
        "name": "after",
        "in": "query",
        "description": "next_cursor of the previous page.",
        "schema": {
          "type": "string"
        }
      },
      "hex64": {
        "name": "hash",
        "in": "path",
        "required": true,
        "description": "64 hex characters (colons allowed).",
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-fA-F:]+$"
        }
      },
      "archive": {
        "name": "archive",
        "in": "query",
        "description": "full: lift the 90-day window; a four-digit year from 2013: certificates valid into that year or later (not_after >= YYYY-01-01). Pro plan only (403 otherwise, uncharged). Any other value is a 400. On /v1/domain and /v1/subdomains an explicit archive= lists by hostname (index key order, grouped by parent zone; no time order inside a name; a certificate with several names in the zone appears once per name).",
        "schema": {
          "type": "string",
          "pattern": "^(full|201[3-9]|20[2-9][0-9])$"
        }
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Keyed requests: the monthly credit limit.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Keyed requests: credits left this month.",
        "schema": {
          "type": "integer"
        }
      },
      "X-Hourly-Limit": {
        "description": "Anonymous and free keys: requests per UTC hour.",
        "schema": {
          "type": "integer"
        }
      },
      "X-Hourly-Remaining": {
        "description": "Anonymous and free keys: requests left this hour.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait (429, 503).",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Malformed input or cursor; a keyed request is refunded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unknown or revoked key (or /v1/usage without one).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "/v1/first-seen or /v1/hosts-history without Pro Lite or Pro, archive=full or a year without Pro, keyless paging past the allowed depth, or paging /v1/hosts without a key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Nothing with that id or name; unknown endpoints say which method you probably meant.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooLarge": {
        "description": "Too many certificates for a newest-first listing (a zone on the scale of amazonaws.com); not charged. Use /v1/hosts/{domain} for the hostnames, or (Pro) add archive=full to list them by hostname.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "One request at a time, or the daily (keyless), hourly or monthly limit.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        }
      },
      "Unavailable": {
        "description": "The answer did not come in time (ClickHouse, the archive tier — \"archive not reached\" — or the store), the server is busy, or a certificate body is temporarily unavailable; retryable: carries Retry-After, and a keyed request is refunded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong; unknown endpoints name the method you probably meant."
          }
        },
        "required": [
          "error"
        ]
      },
      "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"
        ]
      },
      "CertList": {
        "type": "object",
        "properties": {
          "rows": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/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": "#/components/schemas/CACard"
            }
          }
        },
        "required": [
          "rows",
          "has_next",
          "next_cursor"
        ]
      },
      "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"
        ]
      },
      "HostList": {
        "type": "object",
        "properties": {
          "hosts": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/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"
        ]
      },
      "HostsHistoryRow": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "first_seen": {
            "type": "string",
            "description": "First SCT timestamp of the name.",
            "format": "date-time"
          },
          "first_not_before": {
            "type": "string",
            "description": "Earliest validity start.",
            "format": "date-time"
          },
          "last_not_after": {
            "oneOf": [
              {
                "type": "string",
                "description": "Latest expiry; null when the latest record is unknown.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "first_seen",
          "first_not_before"
        ]
      },
      "HostsHistoryList": {
        "type": "object",
        "properties": {
          "apex": {
            "type": "string"
          },
          "hosts": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/HostsHistoryRow"
                }
              },
              {
                "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."
          }
        },
        "required": [
          "apex",
          "hosts",
          "has_next",
          "next_cursor"
        ]
      },
      "FirstSeenRecord": {
        "type": "object",
        "properties": {
          "sct_ts": {
            "type": "string",
            "description": "When the certificate was logged.",
            "format": "date-time"
          },
          "not_before": {
            "type": "string",
            "description": "first_logged only.",
            "format": "date-time"
          },
          "issuer": {
            "type": "string"
          },
          "serial": {
            "type": "string",
            "description": "Serial number, hex."
          }
        },
        "required": [
          "sct_ts",
          "issuer",
          "serial"
        ]
      },
      "FirstSeen": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "matched": {
            "type": "string",
            "description": "The name whose history this is: the name itself or its one-label wildcard parent."
          },
          "first_logged": {
            "$ref": "#/components/schemas/FirstSeenRecord"
          },
          "min_not_before": {
            "type": "string",
            "format": "date-time"
          },
          "last_logged": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FirstSeenRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_not_after": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_ms": {
            "type": "integer"
          }
        },
        "required": [
          "name",
          "matched",
          "first_logged",
          "min_not_before"
        ]
      },
      "Sighting": {
        "type": "object",
        "properties": {
          "log_id": {
            "type": "string",
            "description": "Log id, hex."
          },
          "log_url": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "entry_idx": {
            "type": "integer"
          },
          "is_precert": {
            "type": "boolean"
          },
          "sct_ts": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "log_id",
          "entry_idx",
          "is_precert",
          "sct_ts"
        ]
      },
      "CertDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "issuer_dn": {
            "type": "string"
          },
          "subject_dn": {
            "type": "string"
          },
          "subject_cn": {
            "type": "string"
          },
          "serial_hex": {
            "type": "string"
          },
          "san_dns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "not_before": {
            "type": "string",
            "format": "date-time"
          },
          "not_after": {
            "type": "string",
            "format": "date-time"
          },
          "sig_algo": {
            "type": "string"
          },
          "pubkey_sha256": {
            "type": "string",
            "description": "SHA-256 of the public key: /v1/spki/{hash}."
          },
          "aki": {
            "type": "string",
            "description": "Authority key identifier, hex."
          },
          "issuer_ca": {
            "type": "string",
            "description": "SHA-256 of the issuing CA certificate: /v1/ca/{sha256}."
          },
          "is_ca": {
            "type": "boolean"
          },
          "ext_key_usage": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "policy_oids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "precert_sha256": {
            "type": "string"
          },
          "final_sha256": {
            "type": "string"
          },
          "precert_first_seen": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "final_first_seen": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "sightings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Sighting"
            }
          },
          "precert_body_archived": {
            "type": "boolean",
            "description": "The precertificate body can be downloaded."
          },
          "final_body_archived": {
            "type": "boolean",
            "description": "The final certificate body can be downloaded."
          },
          "precert_body_bytes": {
            "type": "integer"
          },
          "final_body_bytes": {
            "type": "integer"
          },
          "archive": {
            "type": "boolean",
            "description": "Read from the archive store."
          },
          "duration_ms": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "issuer_dn",
          "subject_dn",
          "serial_hex",
          "not_before",
          "not_after",
          "sightings"
        ]
      },
      "BimiAttr": {
        "type": "object",
        "properties": {
          "oid": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "oid",
          "value"
        ]
      },
      "BimiRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "VMC, CMC or empty."
          },
          "subject_o": {
            "type": "string"
          },
          "subject_cn": {
            "type": "string"
          },
          "subject_c": {
            "type": "string"
          },
          "subject_dn": {
            "type": "string"
          },
          "issuer_dn": {
            "type": "string"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "not_before": {
            "type": "string",
            "format": "date-time"
          },
          "not_after": {
            "type": "string",
            "format": "date-time"
          },
          "serial_hex": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "is_precert": {
            "type": "boolean"
          },
          "word_mark": {
            "type": "string"
          },
          "mark_type": {
            "type": "string"
          },
          "trademark_office": {
            "type": "string"
          },
          "trademark_country": {
            "type": "string"
          },
          "trademark_registration": {
            "type": "string"
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BimiAttr"
            }
          },
          "logo_url": {
            "type": "string",
            "description": "Sanitised SVG logo; absent without a logo."
          },
          "logo_hash_ok": {
            "type": "boolean"
          },
          "logo_error": {
            "type": "string"
          },
          "page_url": {
            "type": "string"
          },
          "pem_url": {
            "type": "string"
          },
          "der_url": {
            "type": "string"
          },
          "log_id": {
            "type": "string"
          },
          "log_url": {
            "type": "string"
          },
          "entry_idx": {
            "type": "integer"
          },
          "sct_ts": {
            "type": "string",
            "format": "date-time"
          },
          "parse_error": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "domains",
          "not_before",
          "not_after",
          "serial_hex",
          "sha256"
        ]
      },
      "BimiList": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "domain",
              "org"
            ]
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BimiRow"
            }
          },
          "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."
          },
          "upgrade": {
            "type": "string",
            "description": "When history_truncated is true: where the window is lifted (the plans; for a Pro key, the archive=full parameter)."
          }
        },
        "required": [
          "query",
          "type",
          "rows",
          "has_next",
          "next_cursor"
        ]
      },
      "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"
        ]
      },
      "CADetail": {
        "type": "object",
        "properties": {
          "sha256": {
            "type": "string"
          },
          "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"
          },
          "serial_hex": {
            "type": "string"
          },
          "subject_key_id": {
            "type": "string"
          },
          "authority_key_id": {
            "type": "string"
          },
          "pubkey_sha256": {
            "type": "string"
          },
          "first_seen": {
            "type": "string",
            "format": "date-time"
          },
          "parents": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CACard"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Certificates carrying this certificate's issuer name; null when none."
          },
          "related": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CACard"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Other certificates with this subject (cross-signs, renewals); null when none."
          },
          "ca_id": {
            "type": "integer",
            "description": "Internal issuer id; absent when the CA never issued a certificate we hold."
          },
          "issued": {
            "$ref": "#/components/schemas/CertList"
          },
          "issued_count": {
            "type": "string",
            "description": "Certificates issued in the window: a number, \"10000+\" at the cap, empty when unknown."
          },
          "duration_ms": {
            "type": "integer"
          }
        },
        "required": [
          "sha256",
          "subject_dn",
          "issuer_dn",
          "parents",
          "related",
          "issued",
          "issued_count"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "standard",
              "prolite",
              "pro"
            ]
          },
          "monthly_limit": {
            "type": "integer"
          },
          "used": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "resets_at": {
            "type": "string",
            "format": "date-time"
          },
          "hourly_limit": {
            "type": "integer",
            "description": "Free keys only."
          },
          "hourly_used": {
            "type": "integer",
            "description": "Free keys only."
          },
          "hourly_resets_in_seconds": {
            "type": "integer",
            "description": "Free keys only."
          }
        },
        "required": [
          "plan",
          "monthly_limit",
          "used",
          "remaining",
          "resets_at"
        ]
      }
    }
  }
}
