Write content
patch_nodesApply many node-level patches to a site in ONE call, batched into one new draft version. The primary patch primitive — there is no single-node tool. Each patch entry provides the node_id plus one or more shorthand fields: 'text' for copy (auto-routes to data.text for heading/button/link/nav-link/banner-bar, data.content for text/rich-text/blockquote), 'href' for link destinations, 'src'/'alt' for images, 'slot' to set or correct a node's semantic role. For props not covered by shorthands (level on heading, variant on button, items on accordion), use 'data_patch' — its keys are validated against the primitive schema (prevents silent failures where the renderer ignores your key). Patches are independent: valid ones are saved even if others fail, and each failure comes back in 'rejected' with the reason, so send a small follow-up call for those rather than resending everything. Typical post-create flow: read the manifest, build an array of {node_id, text} entries for every placeholder copy string, send ONE call. Order doesn't matter — patches merge independently. Repeat entries for one node_id are merged; only two different values for the same field are rejected. Node ids are searched in pages, then header/footer/pageLayout, then COLLECTION DETAIL TEMPLATES — so the labels and CTAs around a detail page's {{placeholders}} (get_page (with view: "content")'s collections[].template_nodes) are patchable like anything else; the response names those under collection_templates_touched, because one such patch changes every item page in that collection at once. Returns dead_links when the site is left with an internal link whose target route does not exist — check it before reporting the work done, because a card whose text is right and whose href is stale looks finished and 404s on click. A patch that changes a text colour, a background or a variant is followed by a contrast check of the rendered pages it touched (a few seconds), and text it left unreadable comes back in unreadable_text — fix it before you reply.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patches | Yes | Array of patches, each targeting a node by id. All valid patches are applied as ONE new draft version. Patches are independent: one that names a missing node or an invalid key is skipped and itemized in `rejected` while the rest still land, so a single bad entry no longer discards the batch. Check `patches_rejected` on the response and send a follow-up call for those only. A node_id may appear more than once — the entries are merged for you, and only a genuine disagreement (the same field set to two different values) is rejected. | |
| site_id | Yes |