Reorder layout
move_nodesMove a node to a new position in its page/element tree — reorder it within its current parent (e.g. push a section to the top) or re-parent it under a different container in the SAME tree. This is the safe reordering primitive: it takes node ids (not brittle JSON-Patch index paths) and is validated against the actual tree. position is 'start' / 'end' / { after_id }. Rejects moving a root node, moving a node into itself or its own descendant, and cross-tree moves (use add_page (with copy_of) / insert_nodes for those). Writes one new draft version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | Id of the node to move. | |
| site_id | Yes | ||
| after_id | No | The sibling id, when position is the string 'after'. Equivalent to position: { after_id: '...' } — send either. | |
| position | Yes | Where under the target parent: 'start', 'end', { after_id: '...' }, or 'after' with a separate after_id argument. Both spellings of 'after' are accepted. Required — a move has a destination by definition. | |
| target_parent_id | Yes | Id of the parent the node should move under. Must live in the SAME page/element tree as node_id. |