op, a path into the document, and a value or from. You send the array to (or call gv.pages.patch(...) from the SDK). By the end of this page you will know how to replace a headline, insert a block, remove a section, and guard against concurrent edits.
A working patch
Replacing the headline on the first child of the page’s NavShell:patch.sh
POST /v1/workspaces/{slug}/pages-publish. You can chain a series of patches, preview the draft in the Builder, and publish only when satisfied.
Reading a path
Thepath field is an RFC 6901 JSON Pointer into the document tree. It is a slash-separated string. Each segment is either a JSON object key or an array index.
path-anatomy.txt
/tree/children/0/props/headline reads as “the headline property of the props of the first child of the page tree.” Indexing starts at zero.
One special token: - as the final array segment means “append.” Use it with add to push a new element to the end of an array without computing its index.
Operations
Common patches
Replace a headline
Target theprops of the block you want to update. The path mirrors the document tree.
replace-headline.json
/tree/children/0 addresses the first child of the NavShell — typically the Hero. Adjust the index for whichever block you are targeting.
Append a block
Useadd with "-" to append to the children array without computing the next index.
append-cta.json
"/tree/children/2" inserts at position 2 and shifts existing siblings right.
Remove a block
remove deletes the value at the path. For a block, it deletes the entire subtree.
remove-block.json
remove, the remaining siblings shift down to fill the gap. If your next operation targets a sibling by index, recalculate the index — what was at /tree/children/2 is now at /tree/children/1.
Guard against concurrent edits
Lead with atest operation that asserts the current value. If another writer has changed the document since you fetched it, your test fails and the entire patch is rejected — the document stays unchanged.
guarded-patch.json
Applying patches
- curl
- TypeScript SDK
Draft vs. live
PATCH writes to the draft. Live visitors do not see the change until you publish. This is deliberate — it lets you batch edits, preview in the Builder, and publish atomically. The publish call creates a version snapshot, so any prior live version remains reachable for rollback.