# page_design_apply
Changes the draft of a general page design as the console editor does, one action at a time: start a draft, add, edit, move, duplicate or delete sections, edit preset section items, edit component blocks, edit the compositions of carousel, slide banner and list blocks (properties, blocks, a new template, which overwrites the composition), rearrange mobile, set the header option or import a page template. Exporting a page or section template is a console link, because the browser saves the file. Publishing cannot be undone and happens with the console editor Publish button; template files and images are handled on the console. Called without confirmToken it previews and returns a confirmToken; repeating the same input with it executes once.
## Inputs
| Field | Required here | Contract |
| --- | --- | --- |
| `pageId` | Yes | integer; greater than 0; The general page (PAGE_PATH pageId from pages_get), or the landing page of a legacy promotion link (its targetPageId), which the console edits with the same editor. |
| `action` | Yes | one of: `start_draft`, `add_section`, `update_section`, `update_custom_property`, `move_section`, `duplicate_section`, `delete_section`, `add_item`, `update_item`, `delete_item`, `move_item`, `blocks`, `arrange_mobile`, `header`, `page_template`, `composition_property`, `composition_blocks`, `composition_template`, `export_page`, `export_section`, `publish` (by `kind`) |
| `action.mode` | Yes | When `action.kind` is `start_draft`: `new`, `continue`; new: New Edit from the published page; continue: the unpublished draft. |
| `action.preset` | No | When `action.kind` is `add_section`: `BASE_INTRO`, `BASE_CONTENTS`, `BASE_CONTENTS_CAROUSEL`, `BASE_INFO_BOX`, `BASE_FOOTER`, `EXP_IFRAME` |
| `action.sectionCode` | No | When `action.kind` is `add_section`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.sectionTemplateCode` | No | When `action.kind` is `add_section`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.sectionId` | Yes | When `action.kind` is `update_section`: integer; greater than 0 |
| `action.changes` | Yes | When `action.kind` is `update_section`: object |
| `action.changes.administrativeTitle` | No | When `action.kind` is `update_section`: string; min length 1; max length 100 |
| `action.changes.display` | No | When `action.kind` is `update_section`: boolean |
| `action.changes.template` | No | When `action.kind` is `update_section`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.changes.properties` | No | When `action.kind` is `update_section`: object |
| `action.changes.styles` | No | When `action.kind` is `update_section`: object |
| `action.changes.iframeFile` | No | When `action.kind` is `update_section`: one of: `local-file`, `more-parts`, `complete`, `cancel` (by `kind`) |
| `action.changes.iframeFile.filename` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `local-file`: string; min length 1; max length 240; pattern `^[^/\\:\x00-\x1f\x7f]+$`; The name of the file on this computer, with its extension. |
| `action.changes.iframeFile.byteLength` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `local-file`: integer; greater than 0; The exact file size in bytes (for example from `wc -c < FILE` or `stat`). |
| `action.changes.iframeFile.sha256` | No | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `local-file`: string; pattern `^[0-9a-f]{64}$` |
| `action.changes.iframeFile.uploadId` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `more-parts`: string; pattern `^upl_[A-Za-z0-9_-]{22}$` |
| `action.changes.iframeFile.fromPart` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `more-parts`: integer; minimum 1; maximum 10000 |
| `action.changes.iframeFile.uploadId` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: string; pattern `^upl_[A-Za-z0-9_-]{22}$` |
| `action.changes.iframeFile.parts` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: array; min items 1; max items 10000 |
| `action.changes.iframeFile.parts[].partNumber` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: integer; minimum 1; maximum 10000 |
| `action.changes.iframeFile.parts[].etag` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: string; min length 1; max length 200 |
| `action.changes.iframeFile.measured` | No | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: object; What the video measures on this computer, read with measureCommand. |
| `action.changes.iframeFile.measured.durationSeconds` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: number; maximum 1000000; greater than 0; Video duration in seconds (ffprobe format.duration). |
| `action.changes.iframeFile.measured.frameRate` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: number; maximum 1000; greater than 0; Frames per second (ffprobe avg_frame_rate, for example 30000/1001 = 29.97). |
| `action.changes.iframeFile.measured.width` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: integer; maximum 100000; greater than 0 |
| `action.changes.iframeFile.measured.height` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: integer; maximum 100000; greater than 0 |
| `action.changes.iframeFile.measured.frameRateMode` | No | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: `CFR`, `VFR` |
| `action.changes.iframeFile.measured.minFrameRate` | No | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: number; maximum 1000; greater than 0 |
| `action.changes.iframeFile.measured.maxFrameRate` | No | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `complete`: number; maximum 1000; greater than 0 |
| `action.changes.iframeFile.uploadId` | Yes | When `action.kind` is `update_section` and `action.changes.iframeFile.kind` is `cancel`: string; pattern `^upl_[A-Za-z0-9_-]{22}$` |
| `action.sectionId` | Yes | When `action.kind` is `update_custom_property`: integer; greater than 0 |
| `action.device` | No | When `action.kind` is `update_custom_property`: `DESKTOP`, `MOBILE`; default `DESKTOP` |
| `action.state` | No | When `action.kind` is `update_custom_property`: `NORMAL`, `HOVER`; default `NORMAL` |
| `action.propertyCode` | Yes | When `action.kind` is `update_custom_property`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.specCode` | No | When `action.kind` is `update_custom_property`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.value` | No | When `action.kind` is `update_custom_property`: string; max length 10000 or number or boolean or null or array; items: ; max items 200 or object |
| `action.empty` | No | When `action.kind` is `update_custom_property`: `true` |
| `action.sectionId` | Yes | When `action.kind` is `move_section`: integer; greater than 0 |
| `action.afterSectionId` | Yes | When `action.kind` is `move_section`: integer; greater than 0 or null |
| `action.sectionId` | Yes | When `action.kind` is `duplicate_section` or `delete_section`: integer; greater than 0 |
| `action.sectionId` | Yes | When `action.kind` is `add_item`: integer; greater than 0 |
| `action.sectionId` | Yes | When `action.kind` is `update_item`: integer; greater than 0 |
| `action.itemId` | Yes | When `action.kind` is `update_item`: integer; greater than 0 |
| `action.properties` | No | When `action.kind` is `update_item`: object |
| `action.display` | No | When `action.kind` is `update_item`: boolean |
| `action.sectionId` | Yes | When `action.kind` is `delete_item`: integer; greater than 0 |
| `action.itemId` | Yes | When `action.kind` is `delete_item`: integer; greater than 0 |
| `action.sectionId` | Yes | When `action.kind` is `move_item`: integer; greater than 0 |
| `action.itemId` | Yes | When `action.kind` is `move_item`: integer; greater than 0 |
| `action.afterItemId` | Yes | When `action.kind` is `move_item`: integer; greater than 0 or null |
| `action.sectionId` | Yes | When `action.kind` is `blocks`: integer; greater than 0 |
| `action.device` | No | When `action.kind` is `blocks`: `DESKTOP`, `MOBILE`; default `DESKTOP` |
| `action.operation` | Yes | When `action.kind` is `blocks`: one of: `CREATE`, `UPDATE_PROPERTY_SPECS`, `DELETE`, `DUPLICATE`, `TIE`, `UNTIE`, `ENABLE_HEIGHT_VARIABLE`, `DISABLE_HEIGHT_VARIABLE`, `CHANGE_Z_ORDER`, `EMPTY_PROPERTY` (by `action`) |
| `action.operation.componentBlockCode` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `CREATE`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.componentBlockTemplateCode` | No | When `action.kind` is `blocks` and `action.operation.action` is `CREATE`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.compositionTemplateCode` | No | When `action.kind` is `blocks` and `action.operation.action` is `CREATE`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.preferredValuetype` | No | When `action.kind` is `blocks` and `action.operation.action` is `CREATE`: `VALUE`, `DATA`; default `VALUE` |
| `action.operation.workDir` | No | When `action.kind` is `blocks` and `action.operation.action` is `CREATE`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.propertyCode` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: string; pattern `^[A-Za-z0-9_]{1,80}$`; The block property, for example CB_PLACEMENT_PROP_PLACEMENT (from page_design_get includeBlocks). |
| `action.operation.specCodes` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: array; items: string; pattern `^[A-Za-z0-9_]{1,80}$`; min items 1; max items 20; Every spec code this update writes; each valuePairs specValueMap uses exactly these keys. |
| `action.operation.valuePairs` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: array; min items 1; max items 50; One row per block: [{blockId, specValueMap:{specCode: value}}]. workDir is the folder holding the blocks (/ROOT for top-level blocks), not a block path. |
| `action.operation.valuePairs[].blockId` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: string; min length 1; max length 120; The block id from page_design_get includeBlocks, for example CB_611554. |
| `action.operation.valuePairs[].specValueMap` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: object; Spec code to new value, for example {"CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX": 3}. |
| `action.operation.state` | No | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: `NORMAL`, `HOVER`; default `NORMAL` |
| `action.operation.workDir` | No | When `action.kind` is `blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.targetBlockIds` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `DELETE` or `DUPLICATE` or `TIE` or `UNTIE` or `ENABLE_HEIGHT_VARIABLE` or `DISABLE_HEIGHT_VARIABLE`: array; items: string; min length 1; max length 120; min items 1; max items 50 |
| `action.operation.workDir` | No | When `action.kind` is `blocks` and `action.operation.action` is `DELETE` or `DUPLICATE` or `TIE` or `UNTIE` or `ENABLE_HEIGHT_VARIABLE` or `DISABLE_HEIGHT_VARIABLE`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.targetBlockIds` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `CHANGE_Z_ORDER`: array; items: string; min length 1; max length 120; min items 1; max items 50 |
| `action.operation.zOrderAction` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `CHANGE_Z_ORDER`: `INCREASE`, `DECREASE`, `INCREASE_TO_THE_TOP`, `DECREASE_TO_THE_BOTTOM` |
| `action.operation.workDir` | No | When `action.kind` is `blocks` and `action.operation.action` is `CHANGE_Z_ORDER`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.targetBlockIds` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `EMPTY_PROPERTY`: array; items: string; min length 1; max length 120; min items 1; max items 50 |
| `action.operation.propertyCode` | Yes | When `action.kind` is `blocks` and `action.operation.action` is `EMPTY_PROPERTY`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.workDir` | No | When `action.kind` is `blocks` and `action.operation.action` is `EMPTY_PROPERTY`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.sectionId` | Yes | When `action.kind` is `arrange_mobile`: integer; greater than 0 |
| `action.alg` | No | When `action.kind` is `arrange_mobile`: `ALG_1`, `ALG_3`; default `ALG_3` |
| `action.remoteMenuControlOption` | Yes | When `action.kind` is `header`: `DEFAULT`, `TRANSPARENT`, `HIDDEN`; Default menu, transparent background menu or hidden menu [str_6326, str_6327, str_6328]. |
| `action.sceneTemplateCode` | Yes | When `action.kind` is `page_template`: string; pattern `^[A-Za-z0-9_]{1,80}$`; A page template from page_design_get catalog pageTemplates. |
| `action.sectionId` | Yes | When `action.kind` is `composition_property`: integer; greater than 0 |
| `action.componentBlockId` | Yes | When `action.kind` is `composition_property`: integer; greater than 0; The complex component block (its numeric id from page_design_get includeBlocks). |
| `action.compositionId` | Yes | When `action.kind` is `composition_property`: integer; greater than 0; The composition from page_design_get composition. |
| `action.device` | No | When `action.kind` is `composition_property`: `DESKTOP`, `MOBILE`; default `DESKTOP` |
| `action.propertyCode` | Yes | When `action.kind` is `composition_property`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.specCode` | No | When `action.kind` is `composition_property`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.value` | No | When `action.kind` is `composition_property`: string; max length 10000 or number or boolean or null or array; items: ; max items 200 or object |
| `action.empty` | No | When `action.kind` is `composition_property`: `true` |
| `action.sectionId` | Yes | When `action.kind` is `composition_blocks`: integer; greater than 0 |
| `action.componentBlockId` | Yes | When `action.kind` is `composition_blocks`: integer; greater than 0; The complex component block (its numeric id from page_design_get includeBlocks). |
| `action.compositionId` | Yes | When `action.kind` is `composition_blocks`: integer; greater than 0; The composition from page_design_get composition. |
| `action.device` | No | When `action.kind` is `composition_blocks`: `DESKTOP`, `MOBILE`; default `DESKTOP` |
| `action.operation` | Yes | When `action.kind` is `composition_blocks`: one of: `CREATE`, `UPDATE_PROPERTY_SPECS`, `DELETE`, `DUPLICATE`, `TIE`, `UNTIE`, `ENABLE_HEIGHT_VARIABLE`, `DISABLE_HEIGHT_VARIABLE`, `CHANGE_Z_ORDER`, `EMPTY_PROPERTY` (by `action`) |
| `action.operation.componentBlockCode` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `CREATE`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.componentBlockTemplateCode` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `CREATE`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.compositionTemplateCode` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `CREATE`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.preferredValuetype` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `CREATE`: `VALUE`, `DATA`; default `VALUE` |
| `action.operation.workDir` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `CREATE`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.propertyCode` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: string; pattern `^[A-Za-z0-9_]{1,80}$`; The block property, for example CB_PLACEMENT_PROP_PLACEMENT (from page_design_get includeBlocks). |
| `action.operation.specCodes` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: array; items: string; pattern `^[A-Za-z0-9_]{1,80}$`; min items 1; max items 20; Every spec code this update writes; each valuePairs specValueMap uses exactly these keys. |
| `action.operation.valuePairs` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: array; min items 1; max items 50; One row per block: [{blockId, specValueMap:{specCode: value}}]. workDir is the folder holding the blocks (/ROOT for top-level blocks), not a block path. |
| `action.operation.valuePairs[].blockId` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: string; min length 1; max length 120; The block id from page_design_get includeBlocks, for example CB_611554. |
| `action.operation.valuePairs[].specValueMap` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: object; Spec code to new value, for example {"CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX": 3}. |
| `action.operation.state` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: `NORMAL`, `HOVER`; default `NORMAL` |
| `action.operation.workDir` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `UPDATE_PROPERTY_SPECS`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.targetBlockIds` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `DELETE` or `DUPLICATE` or `TIE` or `UNTIE` or `ENABLE_HEIGHT_VARIABLE` or `DISABLE_HEIGHT_VARIABLE`: array; items: string; min length 1; max length 120; min items 1; max items 50 |
| `action.operation.workDir` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `DELETE` or `DUPLICATE` or `TIE` or `UNTIE` or `ENABLE_HEIGHT_VARIABLE` or `DISABLE_HEIGHT_VARIABLE`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.targetBlockIds` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `CHANGE_Z_ORDER`: array; items: string; min length 1; max length 120; min items 1; max items 50 |
| `action.operation.zOrderAction` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `CHANGE_Z_ORDER`: `INCREASE`, `DECREASE`, `INCREASE_TO_THE_TOP`, `DECREASE_TO_THE_BOTTOM` |
| `action.operation.workDir` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `CHANGE_Z_ORDER`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.operation.targetBlockIds` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `EMPTY_PROPERTY`: array; items: string; min length 1; max length 120; min items 1; max items 50 |
| `action.operation.propertyCode` | Yes | When `action.kind` is `composition_blocks` and `action.operation.action` is `EMPTY_PROPERTY`: string; pattern `^[A-Za-z0-9_]{1,80}$` |
| `action.operation.workDir` | No | When `action.kind` is `composition_blocks` and `action.operation.action` is `EMPTY_PROPERTY`: string; pattern `^\/ROOT(\/[A-Za-z0-9_-]+)*$`; default `/ROOT` |
| `action.sectionId` | Yes | When `action.kind` is `composition_template`: integer; greater than 0 |
| `action.componentBlockId` | Yes | When `action.kind` is `composition_template`: integer; greater than 0; The complex component block (its numeric id from page_design_get includeBlocks). |
| `action.compositionId` | Yes | When `action.kind` is `composition_template`: integer; greater than 0; The composition from page_design_get composition. |
| `action.compositionTemplateCode` | Yes | When `action.kind` is `composition_template`: string; pattern `^[A-Za-z0-9_]{1,80}$`; A template from page_design_get composition.templates. |
| `action.sectionId` | Yes | When `action.kind` is `export_section`: integer; greater than 0 |
| `confirmToken` | No | string; pattern `^ct[a-f\d]{32}$`; The confirmToken from this tool's preview result. Omit it to preview; repeat the same input with it to execute. |