{
  "openapi": "3.1.0",
  "info": {
    "title": "SentinelSAST API",
    "description": "AI-powered Static Application Security Testing platform API",
    "version": "1.0.0",
    "contact": {
      "name": "386 LLC",
      "url": "https://sentinelsast.com"
    }
  },
  "servers": [
    {
      "url": "https://sentinelsast.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/new-audit": {
      "get": {
        "summary": "Start a new security audit",
        "description": "Web interface to create a new AI-powered security audit for code, files, or URLs",
        "operationId": "newAudit",
        "tags": ["audits"]
      }
    },
    "/dashboard": {
      "get": {
        "summary": "View audit dashboard",
        "description": "Personal audit history, findings summary, and security trends",
        "operationId": "getDashboard",
        "tags": ["audits"],
        "security": [{ "bearerAuth": [] }]
      }
    },
    "/audit/{id}": {
      "get": {
        "summary": "View audit detail",
        "description": "Detailed findings, risk score, OWASP mapping, and remediation guidance for a specific audit",
        "operationId": "getAudit",
        "tags": ["audits"],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "security": [{ "bearerAuth": [] }]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Audit": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "input_type": { "type": "string", "enum": ["code", "file", "url"] },
          "status": { "type": "string", "enum": ["pending", "analyzing", "completed", "failed"] },
          "risk_score": { "type": "number", "minimum": 0, "maximum": 100 },
          "total_findings": { "type": "integer" },
          "critical_count": { "type": "integer" },
          "high_count": { "type": "integer" }
        }
      },
      "Finding": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "audit_id": { "type": "string" },
          "title": { "type": "string" },
          "severity": { "type": "string", "enum": ["critical", "high", "medium", "low", "info"] },
          "category": { "type": "string" },
          "owasp_category": { "type": "string" },
          "cwe_id": { "type": "string" },
          "description": { "type": "string" },
          "remediation": { "type": "string" }
        }
      }
    }
  }
}
