Insert section
insert_sectionInsert a brand-new section at a given position on a page. It is added to the page's draft as one section; existing sections are not sent back and are untouched.
Use get_section_defaults first to get a valid section template for the type you want (e.g. HeroWithMedia, Faqs). Assign one fresh UUID and use it for both section.id and uislices[0].id. That UUID becomes the section's logicalId, which every section tool accepts; the result also gives the id hermes stored it under. Then call insert_section with position set to the zero-based index where the new section should appear, or -1 to append at the end. uislices[0].props needs both ctx and cfg, and uislices[0].type must be a type from list_section_types.
Set section.type to "Uislice" for a regular content section (or "Partial" for an embedded partial). The component name (HeroWithMedia, Faqs, etc) goes on uislices[0].type, not on section.type. When inserting a Partial (shared header/footer), use the partial's id (from list_partials) as section.id; its content stays in the partial, so uislices may be left empty.
A uislices[0].collectionId binds the new section to that collection in the same step. Script tags, event handlers and script links in content are refused.
You MUST provide lastVersion from get_page_content latestRevision.version; the insert is refused when the page changed since.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The page ID | |
| section | Yes | The full new section. section.id and uislices[0].id must be the same fresh UUID. | |
| position | Yes | Zero-based index where the new section should appear. Use -1 to append at the end. | |
| projectId | Yes | The project ID | |
| lastVersion | Yes | The current revision version. Required for conflict detection. |