{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/auditae-app/json-schema/auditae-app-audit-schema.json",
  "title": "Audit",
  "description": "A stored audit. Field names are camelCase here, unlike the snake_case POST responses.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/auditae-app-citations-api-openapi.yml#/components/schemas/Audit",
  "type": "object",
  "required": [
    "id",
    "brand",
    "domain",
    "competitorDomains",
    "prompts",
    "engines",
    "createdAt",
    "status",
    "citationRate",
    "visibilityScore",
    "clickValue",
    "results",
    "publicShareId",
    "reportUrl"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "brand": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "competitorDomains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "prompts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "engines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Engine"
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed"
      ]
    },
    "citationRate": {
      "type": "number"
    },
    "visibilityScore": {
      "type": [
        "number",
        "null"
      ],
      "description": "AI Visibility Score, 0–100."
    },
    "clickValue": {
      "type": [
        "object",
        "null"
      ],
      "description": "Google Ads value of the prompts' keywords, in USD cents.",
      "additionalProperties": true
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AuditResult"
      }
    },
    "publicShareId": {
      "type": [
        "string",
        "null"
      ]
    },
    "failureReason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why the run stopped short, when it did."
    },
    "reportUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Shareable report link once the audit is complete."
    }
  },
  "$defs": {
    "AuditResult": {
      "type": "object",
      "description": "One stored cell, in the camelCase the audit store uses.",
      "required": [
        "prompt",
        "engine",
        "brandMentioned",
        "brandUrlCited",
        "position",
        "sourcesReferenced",
        "competitors",
        "sentiment",
        "excerpt"
      ],
      "properties": {
        "prompt": {
          "type": "string"
        },
        "engine": {
          "$ref": "#/$defs/Engine"
        },
        "brandMentioned": {
          "type": "boolean"
        },
        "brandUrlCited": {
          "type": "boolean"
        },
        "position": {
          "type": [
            "integer",
            "null"
          ]
        },
        "sourcesReferenced": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "competitors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sentiment": {
          "type": "string",
          "enum": [
            "positive",
            "neutral",
            "negative",
            "n/a"
          ]
        },
        "excerpt": {
          "type": "string"
        },
        "engineStatus": {
          "type": "string",
          "enum": [
            "success",
            "rate_limited",
            "timeout",
            "parse_error",
            "api_error"
          ]
        },
        "errorMessage": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "Engine": {
      "type": "string",
      "enum": [
        "chatgpt",
        "perplexity",
        "gemini",
        "ai-overviews",
        "ai-mode"
      ],
      "description": "Answer engine. ai-mode is opt-in. Check prices: Perplexity 5¢, ChatGPT 7¢, Google AI Overviews 9¢, Google AI Mode 10¢ (opt-in), Gemini 12¢."
    }
  }
}