{
 "openapi": "3.1.0",
 "info": {
  "title": "Witnessory post-quantum check",
  "version": "0.1.0",
  "description": "Checks one website's post-quantum readiness as a current browser sees it. Free; no key. Signed results; see /llms.txt for verifying them.",
  "contact": {
   "email": "security@witnessory.org"
  },
  "x-pricing": "https://witnessory.org/pricing.json"
 },
 "servers": [
  {
   "url": "https://check.witnessory.org"
  }
 ],
 "paths": {
  "/api/check": {
   "get": {
    "summary": "Check one domain",
    "operationId": "check",
    "parameters": [
     {
      "name": "domain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "example.org"
     }
    ],
    "responses": {
     "200": {
      "description": "The signed result",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Result"
        }
       }
      }
     },
     "400": {
      "description": "Not a public domain name",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The domain's operator asked not to be checked",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "More than 20 new checks an hour from one address (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy (Retry-After)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/badge/{domain}.svg": {
   "get": {
    "summary": "A badge for one domain",
    "operationId": "badge",
    "parameters": [
     {
      "name": "domain",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "An SVG badge (also for invalid names, which show as such)",
      "content": {
       "image/svg+xml": {}
      }
     }
    }
   }
  },
  "/keys": {
   "get": {
    "summary": "Public keys that sign results",
    "operationId": "keys",
    "responses": {
     "200": {
      "description": "PEM public keys by algorithm",
      "content": {
       "application/json": {}
      }
     }
    }
   }
  },
  "/status": {
   "get": {
    "summary": "Service status and counts since start (no visitor data)",
    "operationId": "status",
    "responses": {
     "200": {
      "description": "Status",
      "content": {
       "application/json": {}
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error",
     "code"
    ],
    "properties": {
     "error": {
      "type": "string"
     },
     "code": {
      "type": "string",
      "enum": [
       "missing_domain",
       "address",
       "port",
       "too_long",
       "invalid_domain",
       "non_public",
       "excluded",
       "rate_limited",
       "busy",
       "not_found",
       "method_not_allowed",
       "internal"
      ]
     },
     "retry_after_s": {
      "type": "integer"
     }
    }
   },
   "Result": {
    "type": "object",
    "required": [
     "record",
     "signatures",
     "summary",
     "cached"
    ],
    "properties": {
     "record": {
      "type": "object",
      "properties": {
       "domain": {
        "type": "string"
       },
       "name_checked": {
        "type": "string"
       },
       "level": {
        "type": "string",
        "enum": [
         "ready",
         "partly",
         "not_yet",
         "unknown"
        ]
       },
       "checked_utc": {
        "type": "string",
        "format": "date-time"
       },
       "checker_version": {
        "type": "string"
       },
       "key_exchange": {
        "type": "object"
       },
       "certificate": {
        "type": [
         "object",
         "null"
        ]
       },
       "notes": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "result_sha256": {
        "type": "string"
       }
      }
     },
     "signatures": {
      "type": "object",
      "properties": {
       "ed25519": {
        "type": "string"
       },
       "mldsa65": {
        "type": "string"
       }
      }
     },
     "summary": {
      "type": "string"
     },
     "cached": {
      "type": "boolean"
     },
     "cache_expires_utc": {
      "type": "string",
      "format": "date-time"
     }
    }
   }
  },
  "securitySchemes": {
   "key": {
    "type": "http",
    "scheme": "bearer",
    "description": "A plan's key (optional): fresh checks, counted against the plan's month instead of the address. Plans: https://witnessory.org/pricing.json"
   }
  }
 },
 "security": [
  {},
  {
   "key": []
  }
 ]
}