{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stacktr-ee/json-schema/stacktr-ee-site-upload-schema.json",
  "title": "SiteUpload",
  "description": "Multipart form body for `POST /sites` and `PUT /sites/{idOrSlug}`. Send `file` as a single .html/.htm/.md document or a .zip with an index.html at the root. All other fields are optional string-encoded knobs.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stacktr-ee-openapi.yml#/components/schemas/SiteUpload",
  "type": "object",
  "required": [
    "file"
  ],
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "A single .html, .htm, or .md file, or a .zip containing index.html at the root."
    },
    "public_slug": {
      "type": "string",
      "description": "Requested public subdomain, e.g. \"my-deck\" for my-deck.stacktr.ee (makes the site public). Optional; otherwise the site is unlisted with an unguessable token."
    },
    "reactions": {
      "type": "string",
      "description": "\"true\" to enable on-page emoji reactions and notes."
    },
    "pii_check": {
      "type": "string",
      "enum": [
        "warn",
        "block",
        "off"
      ],
      "description": "Pre-flight scan for email addresses, card numbers, social security numbers, API keys and access tokens. \"warn\" (the default) publishes and says what it found in `pii_warning` (and the X-Stacktree-Pii-Warning header). \"block\" refuses with 422 `pii_detected` and publishes nothing; the MCP tools default to block. \"off\" skips the scan."
    },
    "password": {
      "type": "string",
      "description": "Optional passcode gate. Available on every plan: anonymous publishes, free accounts (each of the 3 free pages can carry one), and paid plans without limit."
    },
    "expires_in_hours": {
      "type": "string",
      "description": "TTL in hours, or \"never\". A NUMBER longer than the plan allows is clamped to the ceiling and the response says so (`expiry_clamped: true`): anonymous caps at 24h, Free at 7 days (168), paid plans have no ceiling. \"never\" on a capped plan is REFUSED instead (409 `expiry_clamped`, nothing published) so that a shortened page can never be reported as permanent; send `accept_clamp` to take the ceiling. Omitted, or sent empty, means the plan default. A value that is neither a positive number of hours nor \"never\" (\"7d\", \"-5\") is 400 `invalid_expiry` and nothing is published. Check `expires_at` / `expires_at_iso` in the response for what you actually got."
    },
    "accept_clamp": {
      "type": "string",
      "description": "\"true\" to accept the plan ceiling when you asked for a page that never expires. Without it that request is refused rather than silently shortened. Has no effect on any other value of expires_in_hours."
    },
    "burn_after_read": {
      "type": "string",
      "description": "\"true\" to delete the site after its first view."
    },
    "e2e": {
      "type": "string",
      "description": "\"true\" if the payload is already AES-GCM ciphertext (end-to-end encrypted; the server stores ciphertext only)."
    },
    "csp_strict": {
      "type": "string",
      "description": "\"true\" to apply a strict Content-Security-Policy."
    },
    "agentation": {
      "type": "string",
      "description": "\"true\" to enable the Agentation annotation toolbar on the published page."
    },
    "client": {
      "type": "string",
      "description": "Client space to file this page under, by name or slug (e.g. \"Acme Co\"). Auto-created if it does not exist. Omit for a floating page. Ignored on anonymous publishes — there is no account to attach the space to."
    },
    "client_path": {
      "type": "string",
      "description": "Optional stable path for this page within the client space (e.g. \"june-report\"). Defaults from the page title. Ignored on anonymous publishes."
    },
    "recipient": {
      "type": "string",
      "description": "Who the page is for, by name (e.g. \"Megan Hanning\"), up to 80 characters. The response then carries `recipient.link`, their own link: opens through it come back with their name, and if they have not opened it an hour after publishing the owner's dashboard says so. Ignored on anonymous and end-to-end encrypted publishes."
    },
    "owner_email": {
      "type": "string",
      "format": "email",
      "description": "Anonymous publishes only: the person the page is for, as the publishing agent knows them. They are emailed the link that keeps the page, and once more when someone else first opens it. Send only with their permission."
    },
    "agent": {
      "type": "string",
      "description": "The publishing assistant's own name, a plain slug (muse, instinct, poke, dots, grok). Analytics only."
    }
  }
}