Stage writes[] + deletes[] in one call; attach routes via writes[].route. writes[].ifMatch (hash from get_site_manifest; "" = must not exist) guards each key (a delete takes { key, ifMatch } too); atomic:true makes one stale key write nothing (409 changeset_conflict). At most 10 writes; each body ≤60KB and the call ≤80KB. Larger new pages: stage_content_chunk then writes[].bodyStaging, or dotsy push / PUT content-raw.
View input schema
{
"type": "object",
"properties": {
"site": {
"type": "string",
"description": "Site slug, e.g. acme-studio"
},
"writes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1
},
"body": {
"type": "string"
},
"bodyStaging": {
"type": "string",
"pattern": "^stg_[a-zA-Z0-9_-]+$"
},
"contentType": {
"type": "string"
},
"ifMatch": {
"type": "string"
},
"route": {
"type": "object",
"properties": {
"path": {
"type": "string",
"minLength": 1
},
"input": {
"type": "object",
"properties": {
"contentKey": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
],
"description": "Explicit content key (default: path-derived). null restores the default (undoes a prior set on PATCH)."
},
"layout": {
"type": [
"string",
"null"
],
"description": "Layout NAME, bare (\"default\" for layouts/default.html), not the file key. Must already exist (400 layout_not_found). null removes it."
},
"title": {
"type": [
"string",
"null"
]
},
"vars": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
]
},
"purpose": {
"type": [
"string",
"null"
]
},
"redirectTo": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
],
"description": "Root-relative redirect target (/…). Required when purpose is \"redirect\"; null clears it once purpose is no longer \"redirect\"."
},
"redirectStatus": {
"anyOf": [
{
"type": "number",
"enum": [
301,
302,
308
]
},
{
"type": "null"
}
],
"description": "301 permanent / 302 or 308 temporary (default 301 on a redirect). null clears an explicit override."
},
"preserveQuery": {
"type": [
"boolean",
"null"
],
"description": "Append the visitor's query string to the redirect target (default true on a redirect). null clears the override."
},
"experiment": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"description": "Stable experiment slug — cookie namespace; unique per site forever."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"hypothesis": {
"type": "string",
"maxLength": 200
},
"status": {
"type": "string",
"enum": [
"draft",
"running",
"ended"
]
},
"variants": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"description": "Variant arm id — default \"a\" / \"b\" on create."
},
"label": {
"type": "string",
"maxLength": 80
},
"weight": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"contentKey": {
"type": "string",
"minLength": 1,
"description": "Published body key (may be routeless)."
}
},
"required": [
"id",
"weight",
"contentKey"
],
"additionalProperties": false
},
"minItems": 2,
"maxItems": 3
},
"goalId": {
"type": "string",
"minLength": 1,
"description": "Optional dotsy conversion goal; omit when tracking in external analytics."
},
"changeNote": {
"type": "string",
"maxLength": 120,
"description": "One line on what the variant changes (0.56e M2); kept so route PATCH round-trips don't strip it."
},
"handsOff": {
"type": "boolean",
"description": "Hands-off mode (0.56e M4): the daily sweep may auto-promote a ≥95% winner or auto-end keep-A after 30 days. Prefer start_test; kept so route PATCH round-trips don't strip it."
},
"startedAt": {
"type": "string"
},
"endedAt": {
"type": "string"
}
},
"required": [
"id",
"name",
"status",
"variants"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"noindex": {
"type": [
"boolean",
"null"
],
"description": "Exclude from sitemap/RSS; inject noindex meta (0.69)."
},
"lang": {
"type": [
"string",
"null"
],
"description": "Page language, e.g. \"es\", \"pt-BR\". null clears (folder or main language applies)."
},
"translationKey": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
],
"description": "Pages sharing a key are translations of each other. null clears."
}
},
"additionalProperties": false
}
},
"required": [
"path",
"input"
],
"additionalProperties": false
},
"menuItems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"sort": {
"type": "integer"
},
"parent": {
"type": [
"string",
"null"
]
},
"label": {
"type": "string",
"minLength": 1
},
"kind": {
"type": "string",
"enum": [
"page",
"url",
"anchor",
"mailto",
"group"
]
},
"ref": {
"type": "string"
},
"newTab": {
"type": "boolean",
"default": false
},
"attrs": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"data": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"html": {
"type": "string"
},
"childShell": {
"type": [
"string",
"null"
]
},
"childTemplate": {
"type": "string"
},
"menu": {
"type": "string",
"minLength": 1
},
"id": {
"type": "string",
"minLength": 1
}
},
"required": [
"sort",
"parent",
"label",
"kind",
"ref",
"menu"
],
"additionalProperties": false
}
}
},
"required": [
"key"
],
"additionalProperties": false
},
"maxItems": 10,
"default": []
},
"deletes": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1
},
"ifMatch": {
"type": "string",
"minLength": 1
}
},
"required": [
"key",
"ifMatch"
],
"additionalProperties": false
}
]
},
"maxItems": 50,
"default": [],
"description": "Keys to delete: a key, or { key, ifMatch } (the hash you read) so a page changed since is not deleted (listed in conflicts)."
},
"message": {
"type": "string",
"maxLength": 2000
},
"atomic": {
"type": "boolean",
"description": "All or nothing: every writes[].ifMatch and deletes[].ifMatch is checked before anything is written. One stale key writes nothing and the call fails with 409 changeset_conflict listing `conflicts`. Default: a stale write is skipped and listed, the rest apply."
},
"context": {
"type": "string",
"minLength": 1,
"description": "Why you're calling this (activity log)."
},
"guestToken": {
"type": "string",
"minLength": 20,
"description": "Guest token from start_site (pgg_…). Omit when signed in with OAuth."
}
},
"required": [
"site"
],
"additionalProperties": false
}