{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dotsy-ai/json-schema/dotsy-ai-share-section-request-schema.json",
  "title": "ShareSectionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dotsy-ai-content-api-openapi.yml#/components/schemas/ShareSectionRequest",
  "type": "object",
  "properties": {
    "sourceKey": {
      "type": "string",
      "minLength": 1,
      "description": "Content key of the page the element is on, e.g. 'about.html'."
    },
    "selector": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "description": "CSS selector of the element in the page's stored HTML (the editor's selector, or one checked with get_content?selector=). It must match exactly one element."
    },
    "ifMatch": {
      "type": "string",
      "minLength": 1,
      "description": "The page's content hash (analyze's sourceEtag). If the page changed since, nothing is written."
    },
    "name": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,64}$",
      "description": "Name of the new section. Default: analyze's proposedName. A name in use answers 409 section_name_taken."
    },
    "scope": {
      "type": "string",
      "enum": [
        "where_found",
        "every_page"
      ],
      "default": "where_found",
      "description": "where_found: each page that has it gets a reference. every_page: one slot in the layout, at the top or bottom of the page content; pages listed in `hide` don't show it."
    },
    "keys": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 1000,
      "description": "Pages with an exact copy to share it on (analyze's matches.keys). Omit for every exact copy. The source page is always included."
    },
    "similar": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 200,
      "description": "Pages with a similar copy (analyze's similar.keys) that take the shared version, losing their own wording. Default none."
    },
    "hide": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 1000,
      "description": "every_page only: pages on the layout that should not show it. Default none."
    },
    "selectors": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000
      },
      "minItems": 1,
      "maxItems": 50,
      "description": "A run of elements that sit next to each other in one parent (only whitespace or comments between), in page order — instead of `selector`. Each must match exactly one element. The section is the run inside one wrapper (`wrapTag`); the pages that hold the same run (the same elements, in the same order, next to each other) take it."
    },
    "wrapTag": {
      "type": "string",
      "enum": [
        "div",
        "section",
        "footer",
        "header",
        "article",
        "aside"
      ],
      "description": "With `selectors`: the wrapper element. Default `footer` when the run is the last of the page content, else `section`."
    },
    "keepLayout": {
      "type": "boolean",
      "description": "With `selectors`: give the wrapper style=\"display:contents\" so a flex or grid parent still lays out the run's elements as before. Default true."
    }
  },
  "required": [
    "sourceKey"
  ]
}