{
  "openapi": "3.1.0",
  "info": {
    "title": "Cited API",
    "version": "1.0.0",
    "description": "AI-search readiness and measured answers for a website. Free: can AI search crawlers (ChatGPT search, Perplexity, Claude, Google, Bing) read the site, and which buyer questions to test; 2 scans/day per client on /api/v1/scan without a key. The paid audit (https://citedfix.pages.dev/pricing/) asks the connected answer engines up to 20 questions and returns the answers, who was named, the sources and the exact prompts, plus a 10-page review and best-practice suggestions, with the pass as a Bearer token. Every route is rate limited (60/min per client). Answers are a dated sample; no ranking or mention is promised.",
    "contact": {
      "email": "contact@optimumtechfusion.com"
    }
  },
  "servers": [
    {
      "url": "https://citedfix.pages.dev"
    }
  ],
  "paths": {
    "/api/v1/scan": {
      "post": {
        "operationId": "scan",
        "summary": "Free AI-search readiness report for one site (no key)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Website address, e.g. example.com",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report: score, grade, checks, profile, queries, platform, Shopify summary, engine answers if connected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "413": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "415": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: Retry-After + RateLimit headers",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Paused (kill switch) or daily capacity reached: Retry-After",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/api/meta": {
      "get": {
        "operationId": "meta",
        "summary": "Connected answer engines, prices and limits",
        "responses": {
          "200": {
            "description": "Meta",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited: Retry-After + RateLimit headers",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Paused (kill switch) or daily capacity reached: Retry-After",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/api/audit/start": {
      "post": {
        "operationId": "auditStart",
        "summary": "Start a paid audit run (uses 1 of 3 runs)",
        "security": [
          {
            "pass": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "profile": {
                    "type": "object",
                    "description": "Corrections: name, category, city, offering, audience"
                  },
                  "queries": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 160
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Run token, scan, homepage summary, page list, questions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Paused (kill switch) or daily capacity reached: Retry-After",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/api/audit/page": {
      "post": {
        "operationId": "auditPage",
        "summary": "Check one more page of the audited site (10 per run)",
        "security": [
          {
            "pass": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "run",
                  "url"
                ],
                "properties": {
                  "run": {
                    "type": "string",
                    "description": "Run token from /api/audit/start (valid 2 hours, one site)"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Page summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/audit/answers": {
      "post": {
        "operationId": "auditAnswers",
        "summary": "Ask the connected answer engines 1-2 questions (20 per run)",
        "security": [
          {
            "pass": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "run",
                  "queries"
                ],
                "properties": {
                  "run": {
                    "type": "string",
                    "description": "Run token from /api/audit/start (valid 2 hours, one site)"
                  },
                  "name": {
                    "type": "string"
                  },
                  "queries": {
                    "type": "array",
                    "maxItems": 2,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rows: query, engine, mentioned, cited, recommended, sources",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "Paused (kill switch) or daily capacity reached: Retry-After",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/api/audit/fixes": {
      "post": {
        "operationId": "auditFixes",
        "summary": "Build the best-practice suggestions and the Markdown report",
        "security": [
          {
            "pass": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "run",
                  "scan",
                  "home"
                ],
                "properties": {
                  "run": {
                    "type": "string",
                    "description": "Run token from /api/audit/start (valid 2 hours, one site)"
                  },
                  "scan": {
                    "type": "object"
                  },
                  "home": {
                    "type": "object"
                  },
                  "pages": {
                    "type": "array"
                  },
                  "answers": {
                    "type": "array"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "fixes[] and markdown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "RFC 9457 problem",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "pass": {
        "type": "http",
        "scheme": "bearer",
        "description": "Audit pass from the payment page"
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "retry_after": {
            "type": "integer"
          }
        }
      },
      "Check": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "weight": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "pass",
              "warn",
              "fail",
              "info",
              "na"
            ]
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "Report": {
        "type": "object",
        "properties": {
          "finalUrl": {
            "type": "string"
          },
          "score": {
            "type": "integer"
          },
          "grade": {
            "type": "string"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Check"
            }
          },
          "profile": {
            "type": "object"
          },
          "queries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "shopify": {
            "type": [
              "object",
              "null"
            ]
          },
          "engines": {
            "type": "array"
          },
          "answers": {
            "type": [
              "array",
              "null"
            ]
          },
          "engineNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "lockedFixes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}