{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-patch-acquisition-content-source-request-schema.json",
  "title": "PatchAcquisitionContentSourceRequest",
  "description": "Partial update for an acquisition-managed content source (JSON Merge Patch, RFC 7396).\nOnly supplied fields are updated; omitted fields retain their current values.\nFields explicitly set to `null` are cleared (where the schema permits).\nTo archive: set `acquisitionConfig.status` to `ARCHIVED`. The `deletesAt` timestamp is computed by the system.\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/PatchAcquisitionContentSourceRequest",
  "type": "object",
  "properties": {
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 500,
      "description": "Updated human-readable description. Set to null to clear."
    },
    "acquisitionConfig": {
      "$ref": "#/$defs/PatchAcquisitionConfig"
    }
  },
  "$defs": {
    "AcquisitionStatus": {
      "type": "string",
      "description": "Lifecycle status of the acquisition config.",
      "enum": [
        "ACTIVE",
        "ARCHIVED"
      ]
    },
    "DiscoverLinksConfig": {
      "type": "object",
      "description": "Link-following discovery settings. When enabled, the crawler follows links\nfound in fetched pages up to `maxDepth` levels from the seed URLs.\n",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether to discover pages by following links.",
          "default": false
        },
        "maxDepth": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum link depth to follow. Capped at 3 to bound crawl fan-out; cap may\nbe raised in future without breaking changes.\n",
          "minimum": 1,
          "maximum": 3,
          "default": 1
        }
      }
    },
    "Discovery": {
      "type": "object",
      "description": "Discovery configuration for content acquisition. Controls how the\nacquisition worker enumerates which URLs to crawl before any page is\nfetched. You can supply explicit sitemap URLs, a list of seed\n`sourceUrls`, or enable link discovery to follow links from the seeds\nup to a bounded depth. At least one of `sitemaps`, `sourceUrls`, or\n`discoverLinks.enabled` must yield URLs, otherwise the run produces\nzero pages.\n",
      "properties": {
        "sitemaps": {
          "type": "array",
          "description": "Explicit sitemap URLs. If omitted, the crawler auto-discovers sitemaps via robots.txt.",
          "maxItems": 50,
          "items": {
            "type": "string",
            "minLength": 1,
            "format": "uri"
          }
        },
        "sourceUrls": {
          "type": "array",
          "description": "Additional URLs to include in acquisition beyond sitemap and link discovery.",
          "maxItems": 1000,
          "items": {
            "type": "string",
            "minLength": 1,
            "format": "uri"
          }
        },
        "filterLinks": {
          "$ref": "#/$defs/FilterLinksConfig"
        },
        "discoverLinks": {
          "$ref": "#/$defs/DiscoverLinksConfig"
        },
        "fetchMode": {
          "$ref": "#/$defs/FetchMode"
        },
        "includePdfs": {
          "type": "boolean",
          "description": "Whether to include PDF documents in the acquisition.",
          "default": false
        },
        "customHeaders": {
          "type": "object",
          "description": "Custom HTTP headers sent with crawler requests.\nAllowed header names are `User-Agent` and `X-Api-Key` (case-insensitive).\nHeader names not on this allowlist will be rejected by the server with a 400 error.\n",
          "additionalProperties": {
            "type": "string"
          }
        },
        "maxResourcesPerRun": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 10000,
          "description": "Per-run upper bound on resources (URLs for website sources) processed.\nUseful for sampling a site before committing to a full acquisition, or\nfor permanently capping crawl scope on large sites. Discovery is not\nresumed across runs — each run starts from `baseUrl`, so this is an\nupper bound per run, not a paging window into the site.\n"
        }
      }
    },
    "FetchMode": {
      "type": "string",
      "description": "Controls how the acquisition worker fetches web pages during content discovery.\n\n- `LIGHTWEIGHT_HTTP` (default): Standard HTTP fetch using simple GET requests.\n  Suitable for most server-rendered websites. Fast and resource-efficient.\n- `HEADLESS`: Fetches pages using a headless Chromium browser (Playwright).\n  Required for JavaScript-heavy sites (SPAs, React/Angular/Vue) where content\n  is rendered client-side. More resource-intensive than lightweight HTTP.\n- `ADAPTIVE`: Automatically determines the optimal fetch mode per site. The\n  acquisition worker samples a subset of URLs using both modes, compares the\n  results, and selects the mode that yields the most complete content.\n",
      "enum": [
        "LIGHTWEIGHT_HTTP",
        "HEADLESS",
        "ADAPTIVE"
      ],
      "default": "LIGHTWEIGHT_HTTP"
    },
    "FieldMapping": {
      "type": "object",
      "description": "Selects which page-level fields the acquisition worker extracts from each crawled\nresource and how they are indexed. Field names refer to **named properties produced\nby the extraction layer** — not to raw HTML tags or CSS selectors. For HTML pages, the\nworker derives these from standard metadata: `title` from `<title>` and Open Graph\nfallbacks; `description` from `<meta name=\"description\">` and Open Graph fallbacks;\n`source` from the page URL; structured metadata fields (`author`, `published`,\n`category`, …) from `<meta>` tags, JSON-LD and Open Graph. For PDF resources, the\nworker derives them from the document metadata. Custom fields exposed by the worker\ncan also be referenced by name.\n\nThe split between `contentFields` and `properties` controls **how** each value is\nindexed:\n* `contentFields` are fulltext-analyzed (tokenized, stemmed) and queryable via\n  fulltext or semantic search.\n* `properties` are stored as exact-match values and queryable via filters, equality,\n  range, prefix, and used for faceting.\n\nWhen omitted on create, the API defaults `contentFields` to `[\"title\",\"description\"]`\nand `properties` to `[\"source\"]`.\n\nEach entry is either a **string** (the property name; type is inferred — `STRING`\nfor textual fields, `LONG`/`DOUBLE` for numeric, `DATE` for ISO-8601 timestamps,\n`BOOLEAN` for boolean) or an **object** `{ field, type }` that overrides the\ninferred type. Supported `type` values: `STRING`, `LONG`, `DOUBLE`, `DATE`, `BOOLEAN`.\nUse the object form when the extracted value's natural type does not match how you\nwant to query it — for example, forcing a numeric-looking string like an SKU to be\nindexed as `STRING` for exact-match filtering.\n\nObject entries may also include `options: { multiValue: { delimiter: \",\" } }`\nto split values from custom HTML `<meta>` tags into arrays during acquisition.\nConfigure this per field; other fields are not split. If a field appears in both\nlists, an options.multiValue setting in either entry applies to that field.\nConflicting delimiters for the same field are invalid.\n\nThe authoritative catalog of extractable field names — including fields surfaced by\nworker plugins — is documented separately in the acquisition worker's extraction\nreference; that catalog can grow over time without a spec change.\n",
      "properties": {
        "contentFields": {
          "type": "array",
          "description": "Fields indexed for fulltext / semantic search (tokenized and analyzed).\nEach entry names an extracted property; use the `{ field, type }` form to\noverride the inferred type or configure multi-value extraction.\n",
          "items": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "$ref": "#/$defs/FieldSpec"
              }
            ]
          },
          "default": [
            "title",
            "description"
          ]
        },
        "properties": {
          "type": "array",
          "description": "Fields indexed for exact-match filtering and faceting. Each entry names an\nextracted property; use the `{ field, type }` form to override the inferred\ntype (e.g. force a date-looking string to be indexed as `STRING`) or configure\nmulti-value extraction.\n",
          "items": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "$ref": "#/$defs/FieldSpec"
              }
            ]
          },
          "default": [
            "source"
          ]
        }
      }
    },
    "FieldSpec": {
      "type": "object",
      "description": "Explicit field entry used in `FieldMapping`. Use this form to configure\nmulti-value extraction or override the type inferred from the extracted value —\nfor example, force a numeric-looking string like an SKU to be indexed as `STRING`\nfor exact-match filtering.\n",
      "required": [
        "field"
      ],
      "properties": {
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "Name of the extracted property."
        },
        "type": {
          "$ref": "#/$defs/IndexFieldType"
        },
        "options": {
          "type": "object",
          "description": "Optional processing settings for the named extracted field.",
          "properties": {
            "multiValue": {
              "type": "object",
              "description": "Opt-in delimiter splitting for values extracted from custom HTML `<meta>` tags.\nThe configured field type applies to each resulting array element,\nnot to the array itself.\n\nDuring acquisition, each extracted string value is split using the literal\ndelimiter. Resulting values are trimmed, empty values are discarded, and\nresults from multiple extracted values are combined into one array. A single\nremaining value is still returned as an array. Missing fields remain absent.\nWhen omitted, delimiter splitting is not applied.\n",
              "required": [
                "delimiter"
              ],
              "properties": {
                "delimiter": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Non-empty literal separator between values, such as a comma or pipe.\nIt is not a regular expression and does not interpret CSV quoting or escaping.\n"
                }
              }
            }
          }
        }
      }
    },
    "FilterLinksConfig": {
      "type": "object",
      "description": "URL filtering rules applied to links discovered during crawl. When enabled,\ndiscovered URLs must match at least one `include` pattern (if any are given)\nand must not match any `exclude` pattern.\n",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether URL filtering is active.",
          "default": true
        },
        "include": {
          "type": "array",
          "description": "Regex patterns for URLs to include.",
          "maxItems": 100,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "exclude": {
          "type": "array",
          "description": "Regex patterns for URLs to exclude.",
          "maxItems": 100,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      }
    },
    "IndexFieldType": {
      "type": "string",
      "enum": [
        "STRING",
        "BOOLEAN",
        "DOUBLE",
        "DATE",
        "LONG"
      ]
    },
    "PatchAcquisitionConfig": {
      "type": "object",
      "description": "Partial acquisition configuration. Only supplied fields are applied.\nObject-typed sub-fields (`discovery`, `schedule`, `fieldMapping`) may be set\nto `null` to clear them. `status` and `baseUrl` are non-nullable.\n",
      "properties": {
        "status": {
          "$ref": "#/$defs/AcquisitionStatus"
        },
        "baseUrl": {
          "type": "string",
          "minLength": 1,
          "format": "uri",
          "description": "Updated root crawl URL."
        },
        "discovery": {
          "type": [
            "object",
            "null"
          ],
          "allOf": [
            {
              "$ref": "#/$defs/Discovery"
            }
          ]
        },
        "schedule": {
          "type": [
            "object",
            "null"
          ],
          "allOf": [
            {
              "$ref": "#/$defs/Schedule"
            }
          ]
        },
        "fieldMapping": {
          "type": [
            "object",
            "null"
          ],
          "allOf": [
            {
              "$ref": "#/$defs/FieldMapping"
            }
          ]
        }
      }
    },
    "Schedule": {
      "type": "object",
      "description": "Scheduling configuration for periodic content acquisition. Optional — when\nomitted or `enabled: false` (the default), acquisition only runs on-demand\nvia `POST /content-sources/acquisition/{name}/runs`.\n",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether the schedule is active.",
          "default": false
        },
        "cronSchedule": {
          "type": "string",
          "minLength": 1,
          "description": "Cron expression (UTC, 5-field: minute hour day-of-month month day-of-week)\ndefining when to start a run. Examples:\n  * `0 2 * * *`   — daily at 02:00 UTC\n  * `0 2 * * 0`   — weekly, Sundays at 02:00 UTC\n  * `0 */6 * * *` — every 6 hours\nOnly honoured when `enabled: true`; otherwise runs must be started via\n`POST /content-sources/acquisition/{name}/runs`.\n"
        }
      }
    }
  }
}