{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/metricspot-com/json-schema/metricspot-com-audit-summary-schema.json",
  "title": "AuditSummary",
  "description": "Row returned by `GET /api/audits` (one per unique URL).",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/metricspot-com-openapi.yaml#/components/schemas/AuditSummary",
  "type": "object",
  "required": [
    "id",
    "domain",
    "url",
    "status",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "integer"
    },
    "domain": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "status": {
      "$ref": "#/$defs/AuditStatus"
    },
    "score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "display_position": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Sort key set via `PATCH /api/audits/reorder`."
    },
    "has_ga": {
      "type": "boolean",
      "description": "True when this URL has a Google Analytics property linked."
    },
    "has_gsc": {
      "type": "boolean",
      "description": "True when this URL has a Search Console site linked."
    }
  },
  "$defs": {
    "AuditStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed"
      ]
    }
  }
}