Publishing

publish_site

Promote the site's current draft to a new published version and return the report. Publishing is refused with E_HOMEPAGE_MISSING when the draft has no page at '/' (the site root would 404); write one with save_page, or pass allow_no_homepage true for a deliberate deep-link-only site. Use when the draft is ready to go live. Whenever a published site exists the result carries public_url, the canonical visitor URL. After publish, call render_page to verify APPEARANCE ONLY: it renders with an owner bypass and does NOT verify the gate/paywall or that a visitor can buy or reach the page. Do not use to preview without publishing.

Behaviour

Effect
Destructive. It can remove or overwrite existing data.
Repeat calls
Idempotent. Repeating the same call produces the same result.
Plan
Available on every plan, including free.

Parameters

NameTypeRequiredDescription
request_idstringYesUnique mutation ID; reuse only to replay identical arguments, new ID after E_CONFLICT.
site_iduuidYesSite UUID from list_sites.
if_revisionstring or nullYesSelected revision from get_site, list_pages or get_page; null only when source is none. Refresh on E_CONFLICT.
allow_no_homepagebooleanNoDeliberate opt-out. Publishing is blocked with E_HOMEPAGE_MISSING when the draft has no '/' page; set true ONLY when the creator genuinely wants a deep-link-only site with no root page.

Returns

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "published"
        },
        "published_version": {
          "type": "object",
          "properties": {
            "label": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "published_at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "label",
            "published_at",
            "page_count"
          ],
          "additionalProperties": false
        },
        "content": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "published"
            },
            "revision": {
              "type": "string",
              "pattern": "^r_[0-9a-f]{32}$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "source",
            "revision",
            "page_count"
          ],
          "additionalProperties": false
        },
        "report": {
          "type": "object",
          "properties": {
            "block_reasons": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "warnings": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "review_flags": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "info": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "orphan_paths": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^\\/[A-Za-z0-9/_-]*$"
              }
            },
            "broken_links": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "from",
                  "href"
                ],
                "additionalProperties": false
              }
            },
            "safe_browsing_hit_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            },
            "has_homepage": {
              "type": "boolean"
            },
            "render_validation": {
              "type": "object",
              "properties": {
                "html": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "markdown": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "jsx": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "svg": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "mermaid": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                }
              },
              "required": [
                "html",
                "markdown",
                "jsx",
                "svg",
                "mermaid"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "block_reasons",
            "warnings",
            "review_flags",
            "info",
            "orphan_paths",
            "broken_links",
            "safe_browsing_hit_count",
            "render_validation"
          ],
          "additionalProperties": false
        },
        "idempotency_replay": {
          "type": "boolean"
        },
        "public_url": {
          "type": "string",
          "format": "uri",
          "description": "Canonical visitor URL for the published site, derived from the server-generated slug. REQUIRED whenever the result represents a published site (outcome 'published', or outcome 'no_changes' with content.source 'published'). Absent only when no site is published: outcome 'blocked', or 'no_changes' with content.source 'none'."
        }
      },
      "required": [
        "outcome",
        "published_version",
        "content",
        "report",
        "idempotency_replay",
        "public_url"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "blocked"
        },
        "content": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "draft"
            },
            "revision": {
              "type": "string",
              "pattern": "^r_[0-9a-f]{32}$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "source",
            "revision",
            "page_count"
          ],
          "additionalProperties": false
        },
        "report": {
          "type": "object",
          "properties": {
            "block_reasons": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "warnings": {
              "maxItems": 50,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "review_flags": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "info": {
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            },
            "orphan_paths": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "pattern": "^\\/[A-Za-z0-9/_-]*$"
              }
            },
            "broken_links": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "from",
                  "href"
                ],
                "additionalProperties": false
              }
            },
            "safe_browsing_hit_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            },
            "has_homepage": {
              "type": "boolean"
            },
            "render_validation": {
              "type": "object",
              "properties": {
                "html": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "markdown": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "jsx": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "svg": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                },
                "mermaid": {
                  "type": "string",
                  "enum": [
                    "validated",
                    "skipped",
                    "absent"
                  ]
                }
              },
              "required": [
                "html",
                "markdown",
                "jsx",
                "svg",
                "mermaid"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "block_reasons",
            "warnings",
            "review_flags",
            "info",
            "orphan_paths",
            "broken_links",
            "safe_browsing_hit_count",
            "render_validation"
          ],
          "additionalProperties": false
        },
        "idempotency_replay": {
          "type": "boolean"
        }
      },
      "required": [
        "outcome",
        "content",
        "report",
        "idempotency_replay"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "no_changes"
        },
        "content": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "published"
            },
            "revision": {
              "type": "string",
              "pattern": "^r_[0-9a-f]{32}$"
            },
            "page_count": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          "required": [
            "source",
            "revision",
            "page_count"
          ],
          "additionalProperties": false
        },
        "idempotency_replay": {
          "type": "boolean"
        },
        "public_url": {
          "type": "string",
          "format": "uri",
          "description": "Canonical visitor URL for the published site, derived from the server-generated slug. REQUIRED whenever the result represents a published site (outcome 'published', or outcome 'no_changes' with content.source 'published'). Absent only when no site is published: outcome 'blocked', or 'no_changes' with content.source 'none'."
        }
      },
      "required": [
        "outcome",
        "content",
        "idempotency_replay",
        "public_url"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "const": "no_changes"
        },
        "content": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "none"
            },
            "revision": {
              "type": "null"
            },
            "page_count": {
              "type": "number",
              "const": 0
            }
          },
          "required": [
            "source",
            "revision",
            "page_count"
          ],
          "additionalProperties": false
        },
        "idempotency_replay": {
          "type": "boolean"
        }
      },
      "required": [
        "outcome",
        "content",
        "idempotency_replay"
      ],
      "additionalProperties": false
    }
  ],
  "type": "object"
}

Using it

publish_site is called by an AI assistant connected to Sentway over MCP, not by hand. Point the assistant at the Sentway MCP endpoint and complete the OAuth flow, and the tool becomes available in the same session as the other 56 Sentway tools. See connecting over MCP.