{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citeladder-com/json-schema/citeladder-com-audit-schedule-schema.json",
  "title": "AuditSchedule",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citeladder-com-audit-schedules-api-openapi.yml#/components/schemas/AuditSchedule",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "project_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "prompt_set_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "audit_scope": {
      "type": "string",
      "enum": [
        "brand",
        "commerce"
      ]
    },
    "cadence": {
      "$ref": "#/$defs/AuditScheduleCadence"
    },
    "interval_minutes": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "timezone": {
      "type": "string"
    },
    "engines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LogicalEngine"
      }
    },
    "market_ids": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "repetitions": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "benchmark_mode": {
      "anyOf": [
        {
          "$ref": "#/$defs/BenchmarkMode"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "next_run_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_run_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "failure_count": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "last_error": {
      "type": "string"
    },
    "last_failure_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "workspace_id",
    "project_id",
    "prompt_set_id",
    "audit_scope",
    "cadence",
    "interval_minutes",
    "timezone",
    "engines",
    "market_ids",
    "repetitions",
    "benchmark_mode",
    "enabled",
    "next_run_at",
    "last_run_at",
    "failure_count",
    "last_error",
    "last_failure_at",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false,
  "$defs": {
    "AuditScheduleCadence": {
      "type": "string",
      "enum": [
        "one_time",
        "every_n_minutes",
        "hourly",
        "daily",
        "weekly"
      ]
    },
    "BenchmarkMode": {
      "type": "string",
      "enum": [
        "consumer_like",
        "controlled_localized",
        "forced_grounded"
      ]
    },
    "LogicalEngine": {
      "type": "string",
      "enum": [
        "chatgpt",
        "gemini",
        "claude",
        "google_ai_overview",
        "chatgpt_search",
        "gemini_consumer"
      ]
    }
  }
}