{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/publishwith-ai/json-schema/publishwith-ai-publish-request-schema.json",
  "title": "PublishRequest",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/publishwith-ai-openapi.yml#/components/schemas/PublishRequest",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Artifact display name. A URL-safe slug is derived from this."
    },
    "mode": {
      "type": "string",
      "enum": [
        "static",
        "dynamic"
      ],
      "default": "static",
      "description": "`static` — upload HTML/CSS/JS files.\n`dynamic` — server-side rendering via YAML manifest + Liquid templates.\n"
    },
    "files": {
      "type": "object",
      "description": "Filename → file content (UTF-8 text).\nRequired for static mode. The entry point is `index.html` (HTML)\nor `index.md` (Markdown, auto-rendered to a styled HTML page).\nAdditional assets (CSS, JS, images, more `.md`/`.html` pages) may\nbe included alongside it as extra keys.\n",
      "properties": {
        "index.html": {
          "type": "string",
          "description": "HTML entry point."
        },
        "index.md": {
          "type": "string",
          "description": "Markdown entry point, auto-rendered to a styled page."
        }
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "manifest": {
      "type": "string",
      "description": "YAML manifest for dynamic mode. Defines queries and routes."
    },
    "templates": {
      "type": "object",
      "description": "Template name → Liquid template content for dynamic mode.",
      "properties": {
        "index.html": {
          "type": "string",
          "description": "Main Liquid template."
        }
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "ttl_days": {
      "type": "integer",
      "description": "Optional time-to-live in days. After this many days the artifact\nauto-goes-offline behind a wall for public visitors; the owner and\nMCP/REST keep access. 0 removes the TTL. Max 365. Omit to leave any\nexisting TTL untouched on re-publish.\n"
    },
    "base_version": {
      "type": "integer",
      "description": "Optional. The version this static update is based on (the version you\nlast read). If another author published a newer version since then,\nthe publish is rejected with 409 VERSION_CHANGED instead of silently\noverwriting their work. Same-author updates need no base_version.\n"
    },
    "confirmation_token": {
      "type": "string",
      "description": "From a 409 VERSION_CHANGED response. Re-call publish with the same\nfiles and this token to overwrite the version another author published.\n"
    }
  }
}