Pages

patch_page

Literal find/replace edits on a draft page (auto-opens from published). find is not regex; 0 matches -> E_PATCH_NO_MATCH, N matches without occurrence -> E_PATCH_AMBIGUOUS (no write). occurrence: "first" or "all". if_revision:null pins to the revision read. Caps: 1..20 edits, find <=2000 B, replace <=5000 B, total <=20000 B. Not for new pages or 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.
pathstringYesPage URL path, e.g. '/pricing'. Leading slash required. '/' is the site's homepage; '/index' is an ordinary page and will NOT serve at the site root.
if_revisionstring or nullYesSelected revision from get_site, list_pages or get_page; null only when source is none. Refresh on E_CONFLICT.
expected_page_typeenum
html | jsx | markdown | svg | mermaid
NoOptional guard: when set, a mismatch with the current page type returns E_CONFLICT and writes nothing.
editsarray of objectYesLiteral find/replace edits applied in order, 1..20 items, <= 20000 combined bytes. Atomic: one invalid edit means no write.

Returns

NameType
pageobject
contentobject
idempotency_replayboolean

Using it

patch_page 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.