{
  "openapi": "3.1.0",
  "info": {
    "title": "Citely Public API",
    "version": "2026-08-01",
    "description": "Public endpoints for the Citely GEO platform. Authenticated customer endpoints are available after signup via Dashboard → Settings → API keys.",
    "contact": {
      "name": "Citely",
      "url": "https://aicitely.com"
    }
  },
  "servers": [
    { "url": "https://aicitely.com", "description": "Production" }
  ],
  "paths": {
    "/api/public/geo-check": {
      "post": {
        "summary": "Run a free deterministic GEO audit",
        "description": "Returns a GEO readiness score, grade, and the top fixes for any public URL. No authentication required. Rate limited per IP.",
        "operationId": "publicGeoCheck",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": { "type": "string", "format": "uri", "description": "The URL to audit." }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audit result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": { "type": "string" },
                        "score": { "type": "integer", "minimum": 0, "maximum": 100 },
                        "grade": { "type": "string", "enum": ["A", "B", "C", "D", "F"] },
                        "criteria": { "type": "object" },
                        "topChanges": { "type": "array", "items": { "type": "string" } },
                        "recommendations": { "type": "array", "items": { "type": "string" } }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": { "description": "Rate limit exceeded" }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Health check",
        "operationId": "healthCheck",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string" },
                    "service": { "type": "string" },
                    "timestamp": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
