{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-acquisition-run-schema.json",
  "title": "AcquisitionRun",
  "description": "Status and progress of an acquisition run. All properties are server-assigned\nand read-only — this schema is only valid in response bodies.\n",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-aem-content-ai-openapi.yml#/components/schemas/AcquisitionRun",
  "type": "object",
  "required": [
    "id",
    "acquisitionName",
    "type",
    "state",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true,
      "minLength": 1,
      "description": "Unique run identifier."
    },
    "acquisitionName": {
      "type": "string",
      "readOnly": true,
      "minLength": 1,
      "description": "Name of the acquisition config this run belongs to."
    },
    "type": {
      "readOnly": true,
      "allOf": [
        {
          "$ref": "#/$defs/RunType"
        }
      ]
    },
    "state": {
      "readOnly": true,
      "allOf": [
        {
          "$ref": "#/$defs/RunState"
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "readOnly": true,
      "format": "date-time",
      "minLength": 1,
      "description": "Timestamp when the run was queued."
    },
    "startedAt": {
      "type": "string",
      "readOnly": true,
      "format": "date-time",
      "description": "Timestamp when processing started."
    },
    "completedAt": {
      "type": "string",
      "readOnly": true,
      "format": "date-time",
      "description": "Timestamp when the run finished."
    },
    "errorMessage": {
      "type": "string",
      "readOnly": true,
      "description": "Error message if the run failed. Null for successful or in-progress runs."
    },
    "adaptiveStrategyDecision": {
      "readOnly": true,
      "allOf": [
        {
          "$ref": "#/$defs/AdaptiveStrategyDecision"
        }
      ]
    },
    "metrics": {
      "type": "array",
      "readOnly": true,
      "description": "Progress metrics and statistics. Updated dynamically as the run progresses.",
      "items": {
        "$ref": "#/$defs/RunMetric"
      }
    },
    "diagnostics": {
      "type": "array",
      "readOnly": true,
      "description": "Customer-facing diagnostics reported for the run, independent of its lifecycle state.",
      "items": {
        "$ref": "#/$defs/RunDiagnostic"
      }
    }
  },
  "$defs": {
    "AdaptiveStrategyDecision": {
      "type": "object",
      "description": "Result of the adaptive fetch mode evaluation. Populated after an `ADAPTIVE` run completes.\nThe acquisition worker samples a subset of URLs with both lightweight HTTP and headless\nfetchers, compares the rendered content, and selects the mode that produces the most\ncomplete results.\n",
      "required": [
        "globalDecision",
        "counter"
      ],
      "properties": {
        "globalDecision": {
          "$ref": "#/$defs/ConcreteFetchMode"
        },
        "counter": {
          "type": "integer",
          "description": "Number of representative URLs evaluated during the adaptive sampling phase.",
          "format": "int32"
        }
      }
    },
    "ConcreteFetchMode": {
      "type": "string",
      "minLength": 1,
      "description": "Concrete fetch mode selected by the adaptive evaluation — always one of the\nreal fetcher implementations, never `ADAPTIVE` itself. The corresponding\nconfiguration value lives in `FetchMode`.\n- `LIGHTWEIGHT_HTTP`: server-rendered HTTP fetch (no JavaScript execution).\n- `HEADLESS`: headless-browser fetch with JavaScript execution.\n",
      "enum": [
        "LIGHTWEIGHT_HTTP",
        "HEADLESS"
      ]
    },
    "RunDiagnostic": {
      "type": "string",
      "minLength": 1,
      "description": "Customer-facing acquisition diagnostic independent of the run lifecycle state.\nClients SHOULD handle unknown values gracefully.\n",
      "x-extensible-enum": [
        "SITE_ACCESS_DENIED",
        "NO_PAGES_FETCHED",
        "PAGES_NOT_FETCHED",
        "SITEMAP_UNAVAILABLE"
      ]
    },
    "RunMetric": {
      "type": "object",
      "description": "A single progress metric recorded for an acquisition run.",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Metric identifier. The set is intentionally open-ended to allow worker plugins to\nemit custom metrics without a spec change; all names follow camelCase convention.\nWell-known names: `pagesDiscovered`, `pagesParsed`, `indexedDocuments`.\nClients SHOULD handle unknown names gracefully.\n"
        },
        "value": {
          "type": "integer",
          "format": "int32",
          "description": "Metric value."
        }
      }
    },
    "RunState": {
      "type": "string",
      "minLength": 1,
      "description": "Current state of an acquisition run.",
      "enum": [
        "QUEUED",
        "PROCESSING",
        "COMPLETED",
        "COMPLETED_WITH_ERRORS",
        "FAILED"
      ]
    },
    "RunType": {
      "type": "string",
      "minLength": 1,
      "description": "How the acquisition run was triggered.",
      "enum": [
        "ON_DEMAND",
        "SCHEDULED"
      ]
    }
  }
}