{
  "openapi": "3.1.0",
  "info": {
    "title": "PDF Checkup API",
    "version": "1.0.0",
    "description": "Free PDF accessibility check: WCAG 2.1 AA and PDF/UA-1 (veraPDF) report by page. Free limits: 30 pages and 20 MB per file. Anonymous use: 3 checks per minute per IP; an API key (X-Api-Key) raises it to 30. Fixes stay in the paid web flow. Docs: https://pdfcheckup.com/for-ai-agents",
    "contact": {
      "url": "https://pdfcheckup.com/for-ai-agents"
    },
    "termsOfService": "https://pdfcheckup.com/terms"
  },
  "servers": [
    {
      "url": "https://pdfcheckup.com"
    }
  ],
  "externalDocs": {
    "url": "https://pdfcheckup.com/for-ai-agents"
  },
  "security": [
    {},
    {
      "apiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      }
    },
    "schemas": {
      "Report": {
        "type": "object",
        "description": "Accessibility report for one PDF: WCAG 2.1 AA checks and PDF/UA-1 (veraPDF) machine checks, with page numbers and plain-English fixes.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "plan": {
            "type": "string",
            "enum": [
              "free"
            ]
          },
          "doc": {
            "type": "object",
            "properties": {
              "pages": {
                "type": "integer"
              },
              "bytes": {
                "type": "integer"
              },
              "title": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "lang": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tagged": {
                "type": "boolean"
              },
              "pdfVersion": {
                "type": "string"
              },
              "producer": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "score": {
                "type": "integer",
                "description": "Share of applicable checks passed, 0-100"
              },
              "passed": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "warnings": {
                "type": "integer"
              },
              "autoFixable": {
                "type": "integer"
              },
              "aiFixable": {
                "type": "integer"
              },
              "manual": {
                "type": "integer"
              },
              "pdfua": {
                "type": "string",
                "enum": [
                  "pass",
                  "fail",
                  "unknown"
                ]
              }
            }
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "fail",
                    "warn",
                    "pass",
                    "na"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "wcag": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "fix": {
                  "type": "string",
                  "enum": [
                    "none",
                    "auto",
                    "ai",
                    "manual",
                    "source"
                  ]
                },
                "pages": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "figures": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "verapdf": {
            "type": [
              "object",
              "null"
            ]
          },
          "links": {
            "type": "object",
            "properties": {
              "checker": {
                "type": "string",
                "format": "uri"
              },
              "remediation": {
                "type": "string",
                "format": "uri"
              }
            }
          },
          "next_steps": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/check": {
      "post": {
        "operationId": "checkPdfAccessibility",
        "summary": "Check a PDF for accessibility (WCAG 2.1 AA, PDF/UA-1)",
        "description": "Send the PDF itself (Content-Type: application/pdf) or a JSON body {\"url\": \"https://…/file.pdf\"} with a public link. Up to 30 pages and 20 MB. The file is deleted right after the check. Typical time 5-30 seconds.",
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public http(s) URL of the PDF"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "400": {
            "description": "Bad input (no file, invalid url)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key"
          },
          "413": {
            "description": "Over the free page or size limit"
          },
          "415": {
            "description": "Unsupported content type"
          },
          "422": {
            "description": "Not a PDF, or the URL could not be downloaded"
          },
          "429": {
            "description": "Rate limited; see Retry-After"
          },
          "503": {
            "description": "Checker busy or waking up; retry"
          }
        }
      }
    }
  }
}